SpyBara
Go Premium

Documentation 2026-10-29 23:57 UTC to 2026-10-30 23:01 UTC

90 files changed +4,589 −4,536. View all changes and history on the product overview
2026
Fri 30 23:01 Thu 29 23:57 Wed 28 23:57 Tue 27 22:59 Mon 26 22:57 Sun 25 23:58 Sat 24 22:59 Fri 23 22:59 Thu 22 22:58 Wed 21 23:02 Tue 20 23:00 Mon 19 23:58 Sat 17 23:57 Fri 16 22:59 Thu 15 23:58 Wed 14 22:58 Tue 13 23:57 Sun 11 23:57 Sat 10 23:01 Fri 9 23:02 Thu 8 22:58 Wed 7 23:59 Tue 6 23:59 Mon 5 23:58 Sun 4 23:58 Sat 3 23:57 Fri 2 22:59 Thu 1 23:59
Details

77* **Python:** check message types with `isinstance()` against classes imported from `claude_agent_sdk` (for example, `isinstance(message, ResultMessage)`).77* **Python:** check message types with `isinstance()` against classes imported from `claude_agent_sdk` (for example, `isinstance(message, ResultMessage)`).

78* **TypeScript:** check the `type` string field (for example, `message.type === "result"`). `AssistantMessage` and `UserMessage` wrap the raw API message in a `.message` field, so content blocks are at `message.message.content`, not `message.content`.78* **TypeScript:** check the `type` string field (for example, `message.type === "result"`). `AssistantMessage` and `UserMessage` wrap the raw API message in a `.message` field, so content blocks are at `message.message.content`, not `message.content`.

79 79 

80> **Example: Check message types and handle results**80> [accordion] Example: Check message types and handle results

81>81>

82> ```python Python theme={null}82> ```python Python theme={null}

83> import asyncio83> import asyncio


273* **`PreCompact` hook:** Run custom logic before compaction occurs, for example to archive the full transcript. The hook receives a `trigger` field (`manual` or `auto`). See [hooks](https://code.claude.com/docs/en/agent-sdk/hooks.md).273* **`PreCompact` hook:** Run custom logic before compaction occurs, for example to archive the full transcript. The hook receives a `trigger` field (`manual` or `auto`). See [hooks](https://code.claude.com/docs/en/agent-sdk/hooks.md).

274* **Manual compaction:** Send `/compact` as a prompt string to trigger compaction on demand. Commands sent this way are ordinary SDK inputs. See [dispatch commands by name](https://code.claude.com/docs/en/agent-sdk/skills.md#dispatch-commands-by-name).274* **Manual compaction:** Send `/compact` as a prompt string to trigger compaction on demand. Commands sent this way are ordinary SDK inputs. See [dispatch commands by name](https://code.claude.com/docs/en/agent-sdk/skills.md#dispatch-commands-by-name).

275 275 

276> **Example: Summarization instructions in CLAUDE.md**276> [accordion] Example: Summarization instructions in CLAUDE.md

277>277>

278> Add a section to your project's CLAUDE.md telling the compactor what to preserve. The header name isn't special; use any clear label.278> Add a section to your project's CLAUDE.md telling the compactor what to preserve. The header name isn't special; use any clear label.

279>279>

Details

42 42 

43Python examples on this page that make HTTP requests use [httpx](https://www.python-httpx.org/). Add it with the package manager your project uses:43Python examples on this page that make HTTP requests use [httpx](https://www.python-httpx.org/). Add it with the package manager your project uses:

44 44 

45**Python (uv)**45> [tab] Python (uv)

46 46>

47```bash theme={null}47> ```bash theme={null}

48uv add httpx48> uv add httpx

49```49> ```

50 

51**Python (pip)**

52 50 

53```bash theme={null}51> [tab] Python (pip)

54pip install httpx52>

55```53> ```bash theme={null}

54> pip install httpx

55> ```

56 56 

57### Weather tool example57### Weather tool example

58 58 


198 198 

199Combine this snippet with the tool and server definitions from the [weather tool example](#weather-tool-example) in one file, `weather.py` or `weather.ts`, then run it from your terminal:199Combine this snippet with the tool and server definitions from the [weather tool example](#weather-tool-example) in one file, `weather.py` or `weather.ts`, then run it from your terminal:

200 200 

201**TypeScript**201> [tab] TypeScript

202 202>

203```bash theme={null}203> ```bash theme={null}

204npx tsx weather.ts204> npx tsx weather.ts

205```205> ```

206 

207**Python (uv)**

208 

209```bash theme={null}

210uv run weather.py

211```

212 

213**Python (pip)**

214 206 

215Activate the virtual environment where you installed the SDK, then run:207> [tab] Python (uv)

208>

209> ```bash theme={null}

210> uv run weather.py

211> ```

216 212 

217```bash theme={null}213> [tab] Python (pip)

218python weather.py214>

219```215> Activate the virtual environment where you installed the SDK, then run:

216>

217> ```bash theme={null}

218> python weather.py

219> ```

220 220 

221Claude calls `get_temperature` and the script prints a one-line answer with the current temperature in San Francisco.221Claude calls `get_temperature` and the script prints a one-line answer with the current temperature in San Francisco.

222 222 

Details

585>585>

586> Open your utility file (`utils.py` or `utils.ts`) in your IDE or editor before running the script. You'll see the file update in real-time as the agent adds doc comments, then revert back to the original when you choose to rewind.586> Open your utility file (`utils.py` or `utils.ts`) in your IDE or editor before running the script. You'll see the file update in real-time as the agent adds doc comments, then revert back to the original when you choose to rewind.

587 587 

588**Python**588> [tab] Python

589 589>

590```bash theme={null}590> ```bash theme={null}

591python try_checkpointing.py591> python try_checkpointing.py

592```592> ```

593 

594**TypeScript**

595 593 

596```bash theme={null}594> [tab] TypeScript

597npx tsx try_checkpointing.ts595>

598```596> ```bash theme={null}

597> npx tsx try_checkpointing.ts

598> ```

599 599 

600You'll see the agent add doc comments, then a prompt asking if you want to rewind. If you choose yes, the file is restored to its original state.600You'll see the agent add doc comments, then a prompt asking if you want to rewind. If you choose yes, the file is restored to its original state.

601 601 

agent-sdk/mcp.md +98 −98

Details

386 386 

387Use the `env` field to pass API keys, tokens, and other credentials to the MCP server:387Use the `env` field to pass API keys, tokens, and other credentials to the MCP server:

388 388 

389**In code**389> [tab] In code

390 390>

391```typescript TypeScript hidelines={1,-1} theme={null}391> ```typescript TypeScript hidelines={1,-1} theme={null}

392const _ = {392> const _ = {

393 options: {393> options: {

394 mcpServers: {394> mcpServers: {

395 "api-server": {395> "api-server": {

396 command: "npx",396> command: "npx",

397 args: ["-y", "@your-org/api-mcp-server"],397> args: ["-y", "@your-org/api-mcp-server"],

398 env: {398> env: {

399 API_KEY: process.env.API_KEY399> API_KEY: process.env.API_KEY

400 }400> }

401 }401> }

402 },402> },

403 allowedTools: ["mcp__api-server__*"]403> allowedTools: ["mcp__api-server__*"]

404 }404> }

405};405> };

406```406> ```

407 407>

408```python Python theme={null}408> ```python Python theme={null}

409options = ClaudeAgentOptions(409> options = ClaudeAgentOptions(

410 mcp_servers={410> mcp_servers={

411 "api-server": {411> "api-server": {

412 "command": "npx",412> "command": "npx",

413 "args": ["-y", "@your-org/api-mcp-server"],413> "args": ["-y", "@your-org/api-mcp-server"],

414 "env": {"API_KEY": os.environ["API_KEY"]},414> "env": {"API_KEY": os.environ["API_KEY"]},

415 }415> }

416 },416> },

417 allowed_tools=["mcp__api-server__*"],417> allowed_tools=["mcp__api-server__*"],

418)418> )

419```419> ```

420 420 

421**.mcp.json**421> [tab] .mcp.json

422 422>

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

424{424> {

425 "mcpServers": {425> "mcpServers": {

426 "api-server": {426> "api-server": {

427 "command": "npx",427> "command": "npx",

428 "args": ["-y", "@your-org/api-mcp-server"],428> "args": ["-y", "@your-org/api-mcp-server"],

429 "env": {429> "env": {

430 "API_KEY": "${API_KEY}"430> "API_KEY": "${API_KEY}"

431 }431> }

432 }432> }

433 }433> }

434}434> }

435```435> ```

436 436>

437The `${API_KEY}` syntax expands environment variables at runtime.437> The `${API_KEY}` syntax expands environment variables at runtime.

438 438 

439### HTTP headers for remote servers439### HTTP headers for remote servers

440 440 

441For HTTP and SSE servers, pass authentication headers directly in the server configuration:441For HTTP and SSE servers, pass authentication headers directly in the server configuration:

442 442 

443**In code**443> [tab] In code

444 444>

445```typescript TypeScript hidelines={1,-1} theme={null}445> ```typescript TypeScript hidelines={1,-1} theme={null}

446const _ = {446> const _ = {

447 options: {447> options: {

448 mcpServers: {448> mcpServers: {

449 "secure-api": {449> "secure-api": {

450 type: "http",450> type: "http",

451 url: "https://api.example.com/mcp",451> url: "https://api.example.com/mcp",

452 headers: {452> headers: {

453 Authorization: `Bearer ${process.env.API_TOKEN}`453> Authorization: `Bearer ${process.env.API_TOKEN}`

454 }454> }

455 }455> }

456 },456> },

457 allowedTools: ["mcp__secure-api__*"]457> allowedTools: ["mcp__secure-api__*"]

458 }458> }

459};459> };

460```460> ```

461 461>

462```python Python theme={null}462> ```python Python theme={null}

463options = ClaudeAgentOptions(463> options = ClaudeAgentOptions(

464 mcp_servers={464> mcp_servers={

465 "secure-api": {465> "secure-api": {

466 "type": "http",466> "type": "http",

467 "url": "https://api.example.com/mcp",467> "url": "https://api.example.com/mcp",

468 "headers": {"Authorization": f"Bearer {os.environ['API_TOKEN']}"},468> "headers": {"Authorization": f"Bearer {os.environ['API_TOKEN']}"},

469 }469> }

470 },470> },

471 allowed_tools=["mcp__secure-api__*"],471> allowed_tools=["mcp__secure-api__*"],

472)472> )

473```473> ```

474 474 

475**.mcp.json**475> [tab] .mcp.json

476 476>

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

478{478> {

479 "mcpServers": {479> "mcpServers": {

480 "secure-api": {480> "secure-api": {

481 "type": "http",481> "type": "http",

482 "url": "https://api.example.com/mcp",482> "url": "https://api.example.com/mcp",

483 "headers": {483> "headers": {

484 "Authorization": "Bearer ${API_TOKEN}"484> "Authorization": "Bearer ${API_TOKEN}"

485 }485> }

486 }486> }

487 }487> }

488}488> }

489```489> ```

490 490>

491The `${API_TOKEN}` syntax expands environment variables at runtime.491> The `${API_TOKEN}` syntax expands environment variables at runtime.

492 492 

493For a complete working example of a remote server authenticated with headers, see [List issues from a repository](#list-issues-from-a-repository).493For a complete working example of a remote server authenticated with headers, see [List issues from a repository](#list-issues-from-a-repository).

494 494 

Details

163 163 

164You can set the permission mode once when starting a query, or change it dynamically while the session is active.164You can set the permission mode once when starting a query, or change it dynamically while the session is active.

165 165 

166**At query time**166> [tab] At query time

167 167>

168Pass `permission_mode` (Python) or `permissionMode` (TypeScript) when creating a query.168> Pass `permission_mode` (Python) or `permissionMode` (TypeScript) when creating a query.

169 169>

170```python Python theme={null}170> ```python Python theme={null}

171import asyncio171> import asyncio

172from claude_agent_sdk import query, ClaudeAgentOptions172> from claude_agent_sdk import query, ClaudeAgentOptions

173 173>

174 174>

175async def main():175> async def main():

176 async for message in query(176> async for message in query(

177 prompt="Help me refactor this code",177> prompt="Help me refactor this code",

178 options=ClaudeAgentOptions(178> options=ClaudeAgentOptions(

179 permission_mode="default", # Set the mode here179> permission_mode="default", # Set the mode here

180 ),180> ),

181 ):181> ):

182 if hasattr(message, "result"):182> if hasattr(message, "result"):

183 print(message.result)183> print(message.result)

184 184>

185 185>

186asyncio.run(main())186> asyncio.run(main())

187```187> ```

188 188>

189```typescript TypeScript theme={null}189> ```typescript TypeScript theme={null}

190import { query } from "@anthropic-ai/claude-agent-sdk";190> import { query } from "@anthropic-ai/claude-agent-sdk";

191 191>

192async function main() {192> async function main() {

193 for await (const message of query({193> for await (const message of query({

194 prompt: "Help me refactor this code",194> prompt: "Help me refactor this code",

195 options: {195> options: {

196 permissionMode: "default" // Set the mode here196> permissionMode: "default" // Set the mode here

197 }197> }

198 })) {198> })) {

199 if ("result" in message) {199> if ("result" in message) {

200 console.log(message.result);200> console.log(message.result);

201 }201> }

202 }202> }

203}203> }

204 204>

205main();205> main();

206```206> ```

207 

208**During streaming**

209 

210Call `set_permission_mode()` (Python) or `setPermissionMode()` (TypeScript) to change the mode mid-session. The new mode takes effect immediately for all subsequent tool requests. This lets you start restrictive and loosen permissions as trust builds, for example switching to `acceptEdits` after reviewing Claude's initial approach.

211 

212```python Python theme={null}

213import asyncio

214from claude_agent_sdk import ClaudeSDKClient, ClaudeAgentOptions

215 

216 

217async def main():

218 async with ClaudeSDKClient(

219 options=ClaudeAgentOptions(

220 permission_mode="default", # Start in default mode

221 )

222 ) as client:

223 await client.query("Help me refactor this code")

224 

225 # Change mode dynamically mid-session

226 await client.set_permission_mode("acceptEdits")

227 

228 # Process messages with the new permission mode

229 async for message in client.receive_response():

230 if hasattr(message, "result"):

231 print(message.result)

232 

233 

234asyncio.run(main())

235```

236 207 

237```typescript TypeScript theme={null}208> [tab] During streaming

238import { query } from "@anthropic-ai/claude-agent-sdk";209>

239 210> Call `set_permission_mode()` (Python) or `setPermissionMode()` (TypeScript) to change the mode mid-session. The new mode takes effect immediately for all subsequent tool requests. This lets you start restrictive and loosen permissions as trust builds, for example switching to `acceptEdits` after reviewing Claude's initial approach.

240async function main() {211>

241 const q = query({212> ```python Python theme={null}

242 prompt: "Help me refactor this code",213> import asyncio

243 options: {214> from claude_agent_sdk import ClaudeSDKClient, ClaudeAgentOptions

244 permissionMode: "default" // Start in default mode215>

245 }216>

246 });217> async def main():

247 218> async with ClaudeSDKClient(

248 // Change mode dynamically mid-session219> options=ClaudeAgentOptions(

249 await q.setPermissionMode("acceptEdits");220> permission_mode="default", # Start in default mode

250 221> )

251 // Process messages with the new permission mode222> ) as client:

252 for await (const message of q) {223> await client.query("Help me refactor this code")

253 if ("result" in message) {224>

254 console.log(message.result);225> # Change mode dynamically mid-session

255 }226> await client.set_permission_mode("acceptEdits")

256 }227>

257}228> # Process messages with the new permission mode

258 229> async for message in client.receive_response():

259main();230> if hasattr(message, "result"):

260```231> print(message.result)

232>

233>

234> asyncio.run(main())

235> ```

236>

237> ```typescript TypeScript theme={null}

238> import { query } from "@anthropic-ai/claude-agent-sdk";

239>

240> async function main() {

241> const q = query({

242> prompt: "Help me refactor this code",

243> options: {

244> permissionMode: "default" // Start in default mode

245> }

246> });

247>

248> // Change mode dynamically mid-session

249> await q.setPermissionMode("acceptEdits");

250>

251> // Process messages with the new permission mode

252> for await (const message of q) {

253> if ("result" in message) {

254> console.log(message.result);

255> }

256> }

257> }

258>

259> main();

260> ```

261 261 

262### Mode details262### Mode details

263 263 

Details

36 36 

37Install the Agent SDK package for your language:37Install the Agent SDK package for your language:

38 38 

39**TypeScript (new project)**39> [tab] TypeScript (new project)

40 40>

41```bash theme={null}41> ```bash theme={null}

42npm init -y42> npm init -y

43npm pkg set type=module43> npm pkg set type=module

44npm install @anthropic-ai/claude-agent-sdk44> npm install @anthropic-ai/claude-agent-sdk

45npm install --save-dev tsx45> npm install --save-dev tsx

46```46> ```

47 47>

48Setting `"type": "module"` in `package.json` lets your agent script use top-level `await`, and [tsx](https://tsx.hirok.io) runs TypeScript files directly. npm prints `added N packages` when the install succeeds.48> Setting `"type": "module"` in `package.json` lets your agent script use top-level `await`, and [tsx](https://tsx.hirok.io) runs TypeScript files directly. npm prints `added N packages` when the install succeeds.

49 

50**TypeScript (existing project)**

51 

52```bash theme={null}

53npm install @anthropic-ai/claude-agent-sdk

54npm install --save-dev tsx

55```

56 

57[tsx](https://tsx.hirok.io) runs TypeScript files directly. If your project uses CommonJS, name your agent script `agent.mts` instead of `agent.ts`. The `.mts` extension makes tsx treat the file as an ES module, so top-level `await` works without converting your whole project to ES modules. Use `agent.mts` in place of `agent.ts` in the create and run steps later in this quickstart.

58 

59**Python (uv)**

60 

61[Install uv](https://docs.astral.sh/uv/), a fast Python package manager that handles virtual environments automatically. Then initialize a project and add the SDK:

62 

63```bash theme={null}

64uv init

65uv add claude-agent-sdk

66```

67 

68**Python (pip)**

69 

70Create and activate a virtual environment, then install the package.

71 

72On macOS or Linux:

73 

74```bash theme={null}

75python3 -m venv .venv

76source .venv/bin/activate

77pip install claude-agent-sdk

78```

79 49 

80On Windows:50> [tab] TypeScript (existing project)

51>

52> ```bash theme={null}

53> npm install @anthropic-ai/claude-agent-sdk

54> npm install --save-dev tsx

55> ```

56>

57> [tsx](https://tsx.hirok.io) runs TypeScript files directly. If your project uses CommonJS, name your agent script `agent.mts` instead of `agent.ts`. The `.mts` extension makes tsx treat the file as an ES module, so top-level `await` works without converting your whole project to ES modules. Use `agent.mts` in place of `agent.ts` in the create and run steps later in this quickstart.

81 58 

82```powershell theme={null}59> [tab] Python (uv)

83py -m venv .venv60>

84.venv\Scripts\Activate.ps161> [Install uv](https://docs.astral.sh/uv/), a fast Python package manager that handles virtual environments automatically. Then initialize a project and add the SDK:

85pip install claude-agent-sdk62>

86```63> ```bash theme={null}

64> uv init

65> uv add claude-agent-sdk

66> ```

87 67 

88If PowerShell blocks `Activate.ps1` with an execution policy error, run `Set-ExecutionPolicy -Scope Process RemoteSigned` first.68> [tab] Python (pip)

69>

70> Create and activate a virtual environment, then install the package.

71>

72> On macOS or Linux:

73>

74> ```bash theme={null}

75> python3 -m venv .venv

76> source .venv/bin/activate

77> pip install claude-agent-sdk

78> ```

79>

80> On Windows:

81>

82> ```powershell theme={null}

83> py -m venv .venv

84> .venv\Scripts\Activate.ps1

85> pip install claude-agent-sdk

86> ```

87>

88> If PowerShell blocks `Activate.ps1` with an execution policy error, run `Set-ExecutionPolicy -Scope Process RemoteSigned` first.

89 89 

90> [!NOTE]90> [!NOTE]

91>91>


98 98 

99Get an API key from the [Claude Console](https://platform.claude.com/), then set it as an environment variable in the shell where you'll run your agent:99Get an API key from the [Claude Console](https://platform.claude.com/), then set it as an environment variable in the shell where you'll run your agent:

100 100 

101**macOS / Linux**101> [tab] macOS / Linux

102 102>

103```bash theme={null}103> ```bash theme={null}

104export ANTHROPIC_API_KEY=your-api-key104> export ANTHROPIC_API_KEY=your-api-key

105```105> ```

106 

107**Windows (PowerShell)**

108 106 

109```powershell theme={null}107> [tab] Windows (PowerShell)

110$env:ANTHROPIC_API_KEY = "your-api-key"108>

111```109> ```powershell theme={null}

110> $env:ANTHROPIC_API_KEY = "your-api-key"

111> ```

112 112 

113The SDK reads the key from the environment of the process that runs your agent; it doesn't load `.env` files automatically. If you keep the key in a `.env` file, load it yourself, for example with the `dotenv` package, before calling the SDK.113The SDK reads the key from the environment of the process that runs your agent; it doesn't load `.env` files automatically. If you keep the key in a `.env` file, load it yourself, for example with the `dotenv` package, before calling the SDK.

114 114 


224 224 

225Your agent is ready. Run it with the following command:225Your agent is ready. Run it with the following command:

226 226 

227**TypeScript**227> [tab] TypeScript

228 228>

229```bash theme={null}229> ```bash theme={null}

230npx tsx agent.ts230> npx tsx agent.ts

231```231> ```

232 232>

233If you named your script `agent.mts`, run `npx tsx agent.mts` instead.233> If you named your script `agent.mts`, run `npx tsx agent.mts` instead.

234 

235**Python (uv)**

236 

237```bash theme={null}

238uv run agent.py

239```

240 

241**Python (pip)**

242 234 

243With your virtual environment still activated:235> [tab] Python (uv)

236>

237> ```bash theme={null}

238> uv run agent.py

239> ```

244 240 

245```bash theme={null}241> [tab] Python (pip)

246python agent.py242>

247```243> With your virtual environment still activated:

244>

245> ```bash theme={null}

246> python agent.py

247> ```

248 248 

249As it works, the agent prints its reasoning and each tool it calls, ending with `Done: success`. After running, check `utils.py`. You'll see defensive code handling empty lists and null users. Your agent autonomously:249As it works, the agent prints its reasoning and each tool it calls, ending with `Done: success`. After running, check `utils.py`. You'll see defensive code handling empty lists and null users. Your agent autonomously:

250 250 

Details

470 470 

471Each SDK surfaces the rejection differently:471Each SDK surfaces the rejection differently:

472 472 

473**TypeScript**473> [tab] TypeScript

474 474>

475The TypeScript SDK throws an `Error` stating the rule the entry broke. For example, `skills: ["docs:*"]` throws:475> The TypeScript SDK throws an `Error` stating the rule the entry broke. For example, `skills: ["docs:*"]` throws:

476 476>

477```text theme={null}477> ```text theme={null}

478Invalid skill name "docs:*": wildcard-suffix names are not allowed; list each skill by its exact name.478> Invalid skill name "docs:*": wildcard-suffix names are not allowed; list each skill by its exact name.

479```479> ```

480 480>

481An empty name reports `Skill names must be non-empty strings.`481> An empty name reports `Skill names must be non-empty strings.`

482 482>

483Before TypeScript Agent SDK 0.3.221, the SDK didn't run this check.483> Before TypeScript Agent SDK 0.3.221, the SDK didn't run this check.

484 

485**Python**

486 

487The Python SDK raises `ValueError` stating the rule the entry broke. For example, `skills=["docs:*"]` raises:

488 

489```text theme={null}

490ValueError: Invalid skill name 'docs:*': wildcard-suffix names are not allowed; list each skill by its exact name.

491```

492 

493An empty name reports `Skill names must be non-empty strings`.

494 484 

495Before Python Agent SDK 0.2.129, the SDK didn't run this check.485> [tab] Python

486>

487> The Python SDK raises `ValueError` stating the rule the entry broke. For example, `skills=["docs:*"]` raises:

488>

489> ```text theme={null}

490> ValueError: Invalid skill name 'docs:*': wildcard-suffix names are not allowed; list each skill by its exact name.

491> ```

492>

493> An empty name reports `Skill names must be non-empty strings`.

494>

495> Before Python Agent SDK 0.2.129, the SDK didn't run this check.

496 496 

497### Additional troubleshooting497### Additional troubleshooting

498 498 

Details

16 16 

17Consider a recipe app where an agent searches the web and brings back recipes. Without structured outputs, you get free-form text that you'd need to parse yourself. With structured outputs, you define the shape you want and get typed data you can use directly in your app.17Consider a recipe app where an agent searches the web and brings back recipes. Without structured outputs, you get free-form text that you'd need to parse yourself. With structured outputs, you define the shape you want and get typed data you can use directly in your app.

18 18 

19> **Without structured outputs**19> [accordion] Without structured outputs

20>20>

21> ```text theme={null}21> ```text theme={null}

22> Here's a classic chocolate chip cookie recipe!22> Here's a classic chocolate chip cookie recipe!


32>32>

33> To use this in your app, you'd need to parse out the title, convert "15 minutes" to a number, separate ingredients from instructions, and handle inconsistent formatting across responses.33> To use this in your app, you'd need to parse out the title, convert "15 minutes" to a number, separate ingredients from instructions, and handle inconsistent formatting across responses.

34 34 

35> **With structured outputs**35> [accordion] With structured outputs

36>36>

37> ```jsonc theme={null}37> ```jsonc theme={null}

38> {38> {

Details

225 225 

226The `ask_user` and `askUser` helpers in the following snippets stand in for your application's own prompt UI.226The `ask_user` and `askUser` helpers in the following snippets stand in for your application's own prompt UI.

227 227 

228**Approve**228> [tab] Approve

229 229>

230The user approves the action as-is. Pass through the `input` from your callback unchanged and the tool executes exactly as Claude requested.230> The user approves the action as-is. Pass through the `input` from your callback unchanged and the tool executes exactly as Claude requested.

231 231>

232```python Python theme={null}232> ```python Python theme={null}

233async def can_use_tool(tool_name, input_data, context):233> async def can_use_tool(tool_name, input_data, context):

234 print(f"Claude wants to use {tool_name}")234> print(f"Claude wants to use {tool_name}")

235 approved = await ask_user("Allow this action?")235> approved = await ask_user("Allow this action?")

236 236>

237 if approved:237> if approved:

238 return PermissionResultAllow(updated_input=input_data)238> return PermissionResultAllow(updated_input=input_data)

239 return PermissionResultDeny(message="User declined")239> return PermissionResultDeny(message="User declined")

240```240> ```

241 241>

242```typescript TypeScript theme={null}242> ```typescript TypeScript theme={null}

243canUseTool: async (toolName, input) => {243> canUseTool: async (toolName, input) => {

244 console.log(`Claude wants to use ${toolName}`);244> console.log(`Claude wants to use ${toolName}`);

245 const approved = await askUser("Allow this action?");245> const approved = await askUser("Allow this action?");

246 246>

247 if (approved) {247> if (approved) {

248 return { behavior: "allow", updatedInput: input };248> return { behavior: "allow", updatedInput: input };

249 }249> }

250 return { behavior: "deny", message: "User declined" };250> return { behavior: "deny", message: "User declined" };

251};251> };

252```252> ```

253 253 

254**Approve with changes**254> [tab] Approve with changes

255 255>

256The user approves but wants to modify the request first. You can change the input before the tool executes. Claude sees the result but isn't told you changed anything. Useful for sanitizing parameters, adding constraints, or scoping access.256> The user approves but wants to modify the request first. You can change the input before the tool executes. Claude sees the result but isn't told you changed anything. Useful for sanitizing parameters, adding constraints, or scoping access.

257 257>

258```python Python theme={null}258> ```python Python theme={null}

259async def can_use_tool(tool_name, input_data, context):259> async def can_use_tool(tool_name, input_data, context):

260 if tool_name == "Bash":260> if tool_name == "Bash":

261 # User approved, but scope all commands to sandbox261> # User approved, but scope all commands to sandbox

262 sandboxed_input = {**input_data}262> sandboxed_input = {**input_data}

263 sandboxed_input["command"] = input_data["command"].replace(263> sandboxed_input["command"] = input_data["command"].replace(

264 "/tmp", "/tmp/sandbox"264> "/tmp", "/tmp/sandbox"

265 )265> )

266 return PermissionResultAllow(updated_input=sandboxed_input)266> return PermissionResultAllow(updated_input=sandboxed_input)

267 return PermissionResultAllow(updated_input=input_data)267> return PermissionResultAllow(updated_input=input_data)

268```268> ```

269 269>

270```typescript TypeScript theme={null}270> ```typescript TypeScript theme={null}

271canUseTool: async (toolName, input) => {271> canUseTool: async (toolName, input) => {

272 if (toolName === "Bash") {272> if (toolName === "Bash") {

273 // User approved, but scope all commands to sandbox273> // User approved, but scope all commands to sandbox

274 const sandboxedInput = {274> const sandboxedInput = {

275 ...input,275> ...input,

276 command: input.command.replace("/tmp", "/tmp/sandbox")276> command: input.command.replace("/tmp", "/tmp/sandbox")

277 };277> };

278 return { behavior: "allow", updatedInput: sandboxedInput };278> return { behavior: "allow", updatedInput: sandboxedInput };

279 }279> }

280 return { behavior: "allow", updatedInput: input };280> return { behavior: "allow", updatedInput: input };

281};281> };

282```282> ```

283 283 

284**Approve and remember**284> [tab] Approve and remember

285 285>

286The user approves and doesn't want to be asked again for this kind of call. The third callback argument carries `suggestions`, an array of ready-made [`PermissionUpdate`](https://code.claude.com/docs/en/agent-sdk/typescript#permissionupdate) entries. Echo one back in `updatedPermissions` to apply it. A suggestion with the `localSettings` destination writes the rule to `.claude/settings.local.json` so future sessions skip the prompt for matching calls.286> The user approves and doesn't want to be asked again for this kind of call. The third callback argument carries `suggestions`, an array of ready-made [`PermissionUpdate`](https://code.claude.com/docs/en/agent-sdk/typescript#permissionupdate) entries. Echo one back in `updatedPermissions` to apply it. A suggestion with the `localSettings` destination writes the rule to `.claude/settings.local.json` so future sessions skip the prompt for matching calls.

287 287>

288In TypeScript, skip the always-allow choice for a request whose options carry [`suppressAlwaysAllowRule: true`](https://code.claude.com/docs/en/agent-sdk/typescript#canusetool). The hint requires Agent SDK v0.3.268 or later, and the Python `context` doesn't carry it.288> In TypeScript, skip the always-allow choice for a request whose options carry [`suppressAlwaysAllowRule: true`](https://code.claude.com/docs/en/agent-sdk/typescript#canusetool). The hint requires Agent SDK v0.3.268 or later, and the Python `context` doesn't carry it.

289 289>

290The Python example requires `claude-agent-sdk` 0.1.80 or later.290> The Python example requires `claude-agent-sdk` 0.1.80 or later.

291 291>

292```python Python theme={null}292> ```python Python theme={null}

293async def can_use_tool(tool_name, input_data, context):293> async def can_use_tool(tool_name, input_data, context):

294 choice = await ask_user(f"Allow {tool_name}?", ["once", "always", "no"])294> choice = await ask_user(f"Allow {tool_name}?", ["once", "always", "no"])

295 295>

296 if choice == "always":296> if choice == "always":

297 persist = [297> persist = [

298 s for s in context.suggestions if s.destination == "localSettings"298> s for s in context.suggestions if s.destination == "localSettings"

299 ]299> ]

300 return PermissionResultAllow(300> return PermissionResultAllow(

301 updated_input=input_data, updated_permissions=persist301> updated_input=input_data, updated_permissions=persist

302 )302> )

303 if choice == "once":303> if choice == "once":

304 return PermissionResultAllow(updated_input=input_data)304> return PermissionResultAllow(updated_input=input_data)

305 return PermissionResultDeny(message="User declined")305> return PermissionResultDeny(message="User declined")

306```306> ```

307 307>

308```typescript TypeScript theme={null}308> ```typescript TypeScript theme={null}

309canUseTool: async (toolName, input, { suggestions = [] }) => {309> canUseTool: async (toolName, input, { suggestions = [] }) => {

310 const choice = await askUser(`Allow ${toolName}?`, ["once", "always", "no"]);310> const choice = await askUser(`Allow ${toolName}?`, ["once", "always", "no"]);

311 311>

312 if (choice === "always") {312> if (choice === "always") {

313 const persist = suggestions.filter(313> const persist = suggestions.filter(

314 (s) => s.destination === "localSettings"314> (s) => s.destination === "localSettings"

315 );315> );

316 return {316> return {

317 behavior: "allow",317> behavior: "allow",

318 updatedInput: input,318> updatedInput: input,

319 updatedPermissions: persist319> updatedPermissions: persist

320 };320> };

321 }321> }

322 if (choice === "once") {322> if (choice === "once") {

323 return { behavior: "allow", updatedInput: input };323> return { behavior: "allow", updatedInput: input };

324 }324> }

325 return { behavior: "deny", message: "User declined" };325> return { behavior: "deny", message: "User declined" };

326};326> };

327```327> ```

328 328 

329**Reject**329> [tab] Reject

330 330>

331The user doesn't want this action to happen. Block the tool and provide a message explaining why. Claude sees this message and may try a different approach.331> The user doesn't want this action to happen. Block the tool and provide a message explaining why. Claude sees this message and may try a different approach.

332 332>

333```python Python theme={null}333> ```python Python theme={null}

334async def can_use_tool(tool_name, input_data, context):334> async def can_use_tool(tool_name, input_data, context):

335 approved = await ask_user(f"Allow {tool_name}?")335> approved = await ask_user(f"Allow {tool_name}?")

336 336>

337 if not approved:337> if not approved:

338 return PermissionResultDeny(message="User rejected this action")338> return PermissionResultDeny(message="User rejected this action")

339 return PermissionResultAllow(updated_input=input_data)339> return PermissionResultAllow(updated_input=input_data)

340```340> ```

341 341>

342```typescript TypeScript theme={null}342> ```typescript TypeScript theme={null}

343canUseTool: async (toolName, input) => {343> canUseTool: async (toolName, input) => {

344 const approved = await askUser(`Allow ${toolName}?`);344> const approved = await askUser(`Allow ${toolName}?`);

345 345>

346 if (!approved) {346> if (!approved) {

347 return {347> return {

348 behavior: "deny",348> behavior: "deny",

349 message: "User rejected this action"349> message: "User rejected this action"

350 };350> };

351 }351> }

352 return { behavior: "allow", updatedInput: input };352> return { behavior: "allow", updatedInput: input };

353};353> };

354```354> ```

355 355 

356**Suggest alternative**356> [tab] Suggest alternative

357 357>

358The user doesn't want this specific action, but has a different idea. Block the tool and include guidance in your message. Claude will read this and decide how to proceed based on your feedback.358> The user doesn't want this specific action, but has a different idea. Block the tool and include guidance in your message. Claude will read this and decide how to proceed based on your feedback.

359 359>

360```python Python theme={null}360> ```python Python theme={null}

361async def can_use_tool(tool_name, input_data, context):361> async def can_use_tool(tool_name, input_data, context):

362 if tool_name == "Bash" and "rm" in input_data.get("command", ""):362> if tool_name == "Bash" and "rm" in input_data.get("command", ""):

363 # User doesn't want to delete, suggest archiving instead363> # User doesn't want to delete, suggest archiving instead

364 return PermissionResultDeny(364> return PermissionResultDeny(

365 message="User doesn't want to delete files. They asked if you could compress them into an archive instead."365> message="User doesn't want to delete files. They asked if you could compress them into an archive instead."

366 )366> )

367 return PermissionResultAllow(updated_input=input_data)367> return PermissionResultAllow(updated_input=input_data)

368```368> ```

369 369>

370```typescript TypeScript theme={null}370> ```typescript TypeScript theme={null}

371canUseTool: async (toolName, input) => {371> canUseTool: async (toolName, input) => {

372 if (toolName === "Bash" && input.command.includes("rm")) {372> if (toolName === "Bash" && input.command.includes("rm")) {

373 // User doesn't want to delete, suggest archiving instead373> // User doesn't want to delete, suggest archiving instead

374 return {374> return {

375 behavior: "deny",375> behavior: "deny",

376 message:376> message:

377 "User doesn't want to delete files. They asked if you could compress them into an archive instead."377> "User doesn't want to delete files. They asked if you could compress them into an archive instead."

378 };378> };

379 }379> }

380 return { behavior: "allow", updatedInput: input };380> return { behavior: "allow", updatedInput: input };

381};381> };

382```382> ```

383 383 

384**Redirect entirely**384> [tab] Redirect entirely

385 385>

386For a complete change of direction (not just a nudge), use [streaming input](https://code.claude.com/docs/en/agent-sdk/streaming-vs-single-mode.md) to send Claude a new instruction directly. This bypasses the current tool request and gives Claude entirely new instructions to follow.386> For a complete change of direction (not just a nudge), use [streaming input](https://code.claude.com/docs/en/agent-sdk/streaming-vs-single-mode.md) to send Claude a new instruction directly. This bypasses the current tool request and gives Claude entirely new instructions to follow.

387 387 

388## Handle clarifying questions388## Handle clarifying questions

389 389 

agents.md +1 −1

Details

13| [Subagents](https://code.claude.com/docs/en/sub-agents.md) | Delegated workers inside one session that do a side task in their own context and return a summary | A side task would flood your main conversation with search results, logs, or file contents you won't reference again |13| [Subagents](https://code.claude.com/docs/en/sub-agents.md) | Delegated workers inside one session that do a side task in their own context and return a summary | A side task would flood your main conversation with search results, logs, or file contents you won't reference again |

14| [Agent view](https://code.claude.com/docs/en/agent-view.md) | One screen to dispatch and monitor sessions running in the background, opened with `claude agents`. Research preview | You have several independent tasks and want to hand them off, check status at a glance, and step in only when one needs you |14| [Agent view](https://code.claude.com/docs/en/agent-view.md) | One screen to dispatch and monitor sessions running in the background, opened with `claude agents`. Research preview | You have several independent tasks and want to hand them off, check status at a glance, and step in only when one needs you |

15| [Agent teams](https://code.claude.com/docs/en/agent-teams.md) | Multiple coordinated sessions with a shared task list and inter-agent messaging, managed by a lead. Experimental and disabled by default | You want Claude to split a project into pieces, assign them, and keep the workers in sync |15| [Agent teams](https://code.claude.com/docs/en/agent-teams.md) | Multiple coordinated sessions with a shared task list and inter-agent messaging, managed by a lead. Experimental and disabled by default | You want Claude to split a project into pieces, assign them, and keep the workers in sync |

16| [Projects](https://code.claude.com/docs/en/claude-projects.md) | One ongoing conversation at claude.ai/code or in the desktop app. Claude starts parallel sessions called threads, in the cloud or, when you ask, on your computer through Remote Control, gives each one the project's instructions, and shows you which ones need you. Public beta on Pro and Max | The work spans many tasks over days or weeks, should keep running when your machine is off, and you'd rather describe it once than dispatch and track each session |16| [Projects](https://code.claude.com/docs/en/claude-projects.md) | One ongoing conversation at claude.ai/code or in the desktop app. Claude starts parallel sessions called threads, in the cloud or, when you ask, on your computer through Remote Control. It gives each one the project's instructions and shows you which ones need you. Public beta on Pro, Max, and Ultra | The work spans many tasks over days or weeks, should keep running when your machine is off, and you'd rather describe it once than dispatch and track each session |

17| [Dynamic workflows](https://code.claude.com/docs/en/workflows.md) | A script that runs many subagents and cross-checks their results, for work too big to coordinate one turn at a time or that needs more than a single pass | A job outgrows a handful of subagents, or you want findings verified against each other: a codebase-wide audit, a 500-file migration, cross-checked research, or a plan drafted from several angles |17| [Dynamic workflows](https://code.claude.com/docs/en/workflows.md) | A script that runs many subagents and cross-checks their results, for work too big to coordinate one turn at a time or that needs more than a single pass | A job outgrows a handful of subagents, or you want findings verified against each other: a codebase-wide audit, a 500-file migration, cross-checked research, or a plan drafted from several angles |

18 18 

19In every approach the workers are Claude sessions. To involve a different tool, expose it to Claude as an [MCP server](https://code.claude.com/docs/en/mcp.md).19In every approach the workers are Claude sessions. To involve a different tool, expose it to Claude as an [MCP server](https://code.claude.com/docs/en/mcp.md).

artifacts.md +4 −4

Details

8 8 

9> [!NOTE]9> [!NOTE]

10>10>

11> Artifacts are available on Pro, Max, Team, and Enterprise plans and require a session signed in with [`/login`](https://code.claude.com/docs/en/setup#authenticate). See [Availability](#availability) for the full set of requirements.11> Artifacts are available on Pro, Max, Ultra, Team, and Enterprise plans and require a session signed in with [`/login`](https://code.claude.com/docs/en/setup#authenticate). See [Availability](#availability) for the full set of requirements.

12 12 

13An [artifact](https://claude.com/features/artifacts) is a live, interactive web page that Claude Code publishes from your session to a private URL on claude.ai. You open it in a browser, and it updates in place as the session continues. Share it from the page header when you want someone else to see it too.13An [artifact](https://claude.com/features/artifacts) is a live, interactive web page that Claude Code publishes from your session to a private URL on claude.ai. You open it in a browser, and it updates in place as the session continues. Share it from the page header when you want someone else to see it too.

14 14 


197 197 

198## Pull live data with MCP connectors198## Pull live data with MCP connectors

199 199 

200An artifact can call [MCP connectors](https://code.claude.com/docs/en/mcp.md#use-mcp-servers-from-claude-ai) each time someone views it, so the page shows current data rather than a snapshot from the session that built it. Connector calls from artifacts are available on Pro, Max, Team, and Enterprise plans and require Claude Code v2.1.209 or later. On earlier versions, Claude publishes the page with whatever data the session gathered while building it.200An artifact can call [MCP connectors](https://code.claude.com/docs/en/mcp.md#use-mcp-servers-from-claude-ai) each time someone views it, so the page shows current data rather than a snapshot from the session that built it. Connector calls from artifacts are available on Pro, Max, Ultra, Team, and Enterprise plans and require Claude Code v2.1.209 or later. On earlier versions, Claude publishes the page with whatever data the session gathered while building it.

201 201 

202To create a connector-backed page, name the connector and the data you want in your prompt:202To create a connector-backed page, name the connector and the data you want in your prompt:

203 203 


314 314 

315> [!NOTE]315> [!NOTE]

316>316>

317> Templates are in beta. They're on by default on Pro, Max, and Team plans. On Enterprise plans, an Owner [turns each template on](https://support.claude.com/en/articles/16994751-artifacts-admin-guide-for-team-and-enterprise-plans) under **Organization settings > Artifacts**. If your organization has the Slides template turned off, `/slides` doesn't appear; if it has the Design template turned off, `/design` doesn't draft designs. Both commands require Claude Code v2.1.265 or later and a session where [artifacts are available](#availability).317> Templates are in beta. They're on by default on Pro, Max, Ultra, and Team plans. On Enterprise plans, an Owner [turns each template on](https://support.claude.com/en/articles/16994751-artifacts-admin-guide-for-team-and-enterprise-plans) under **Organization settings > Artifacts**. If your organization has the Slides template turned off, `/slides` doesn't appear; if it has the Design template turned off, `/design` doesn't draft designs. Both commands require Claude Code v2.1.265 or later and a session where [artifacts are available](#availability).

318 318 

319### Make a slide deck319### Make a slide deck

320 320 


368 368 

369| Requirement | Available when |369| Requirement | Available when |

370| :- | :- |370| :- | :- |

371| Plan | Pro, Max, Team, or Enterprise. On Pro and Max plans, artifacts are private to you until you share them, and no admin management applies. On Team and Enterprise plans, artifacts are on by default, and an Owner can [turn them off for the organization](#manage-artifacts-for-your-organization) in claude.ai admin settings. |371| Plan | Pro, Max, Ultra, Team, or Enterprise. On Pro, Max, and Ultra plans, artifacts are private to you until you share them, and no admin management applies. On Team and Enterprise plans, artifacts are on by default, and an Owner can [turn them off for the organization](#manage-artifacts-for-your-organization) in claude.ai admin settings. |

372| Authentication | The session is backed by a claude.ai account: sign in with `/login` in the CLI or desktop app. Claude Tag sessions need no sign-in step. Sessions using an API key, [gateway token](https://code.claude.com/docs/en/llm-gateway), or cloud-provider credential cannot publish. |372| Authentication | The session is backed by a claude.ai account: sign in with `/login` in the CLI or desktop app. Claude Tag sessions need no sign-in step. Sessions using an API key, [gateway token](https://code.claude.com/docs/en/llm-gateway), or cloud-provider credential cannot publish. |

373| Model provider | Anthropic API. Not available on [Amazon Bedrock](https://code.claude.com/docs/en/amazon-bedrock.md), [Google Cloud's Agent Platform](https://code.claude.com/docs/en/google-vertex-ai.md), or [Microsoft Foundry](https://code.claude.com/docs/en/microsoft-foundry.md). |373| Model provider | Anthropic API. Not available on [Amazon Bedrock](https://code.claude.com/docs/en/amazon-bedrock.md), [Google Cloud's Agent Platform](https://code.claude.com/docs/en/google-vertex-ai.md), or [Microsoft Foundry](https://code.claude.com/docs/en/microsoft-foundry.md). |

374| Organization policy | Customer-managed encryption keys (CMEK), HIPAA, and [Zero Data Retention](https://code.claude.com/docs/en/zero-data-retention.md) are not enabled for the organization. |374| Organization policy | Customer-managed encryption keys (CMEK), HIPAA, and [Zero Data Retention](https://code.claude.com/docs/en/zero-data-retention.md) are not enabled for the organization. |

authentication.md +21 −21

Details

23 23 

24You can authenticate with any of these account types:24You can authenticate with any of these account types:

25 25 

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

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

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

29* **Cloud providers**: if your organization uses [Amazon Bedrock](https://code.claude.com/docs/en/amazon-bedrock.md), [Google Cloud's Agent Platform](https://code.claude.com/docs/en/google-vertex-ai.md), or [Microsoft Foundry](https://code.claude.com/docs/en/microsoft-foundry.md), set the required environment variables before running `claude`, or select **3rd-party platform** at the login prompt, which launches an interactive setup wizard for Bedrock and Vertex AI. No browser login is needed.29* **Cloud providers**: if your organization uses [Amazon Bedrock](https://code.claude.com/docs/en/amazon-bedrock.md), [Google Cloud's Agent Platform](https://code.claude.com/docs/en/google-vertex-ai.md), or [Microsoft Foundry](https://code.claude.com/docs/en/microsoft-foundry.md), set the required environment variables before running `claude`, or select **3rd-party platform** at the login prompt, which launches an interactive setup wizard for Bedrock and Vertex AI. No browser login is needed.


2534. [`apiKeyHelper`](https://code.claude.com/docs/en/settings-reference#apikeyhelper) script output. Use this for dynamic or rotating credentials, such as short-lived tokens fetched from a vault.2534. [`apiKeyHelper`](https://code.claude.com/docs/en/settings-reference#apikeyhelper) script output. Use this for dynamic or rotating credentials, such as short-lived tokens fetched from a vault.

2545. `CLAUDE_CODE_OAUTH_TOKEN` environment variable. A long-lived OAuth token generated by [`claude setup-token`](#generate-a-long-lived-token). Use this for CI pipelines and scripts where browser login isn't available. If you run `/login` while the variable is set, Claude Code switches the current session to the new login, but reads the variable again in every new session until you remove it from your shell profile or the `env` block of a [settings file](https://code.claude.com/docs/en/settings.md).2545. `CLAUDE_CODE_OAUTH_TOKEN` environment variable. A long-lived OAuth token generated by [`claude setup-token`](#generate-a-long-lived-token). Use this for CI pipelines and scripts where browser login isn't available. If you run `/login` while the variable is set, Claude Code switches the current session to the new login, but reads the variable again in every new session until you remove it from your shell profile or the `env` block of a [settings file](https://code.claude.com/docs/en/settings.md).

2556. Anthropic profile and federation credentials, the credentials that the `ant` CLI and Workload Identity Federation use. A profile that `ant auth login` wrote ranks here only when you name it in `ANTHROPIC_PROFILE`; otherwise it ranks below `/login`. See [Anthropic profiles and federation credentials](#anthropic-profiles-and-federation-credentials).2556. Anthropic profile and federation credentials, the credentials that the `ant` CLI and Workload Identity Federation use. A profile that `ant auth login` wrote ranks here only when you name it in `ANTHROPIC_PROFILE`; otherwise it ranks below `/login`. See [Anthropic profiles and federation credentials](#anthropic-profiles-and-federation-credentials).

2567. Subscription OAuth credentials from `/login`. This is the default for Claude Pro, Max, Team, and Enterprise users.2567. Subscription OAuth credentials from `/login`. This is the default for Claude Pro, Max, Ultra, Team, and Enterprise users.

257 257 

258A signed-in [Claude apps gateway](https://code.claude.com/docs/en/claude-apps-gateway) session sits outside this list: it is a provider selection like Amazon Bedrock or Google Cloud's Agent Platform, and it outranks them. When a gateway session exists, the CLI authenticates with the gateway token even if `CLAUDE_CODE_USE_BEDROCK`, `CLAUDE_CODE_USE_VERTEX`, or `CLAUDE_CODE_USE_FOUNDRY` is set, and credential sources above such as the bearer token, API key, `apiKeyHelper`, and profiles are not used.258A signed-in [Claude apps gateway](https://code.claude.com/docs/en/claude-apps-gateway) session sits outside this list: it is a provider selection like Amazon Bedrock or Google Cloud's Agent Platform, and it outranks them. When a gateway session exists, the CLI authenticates with the gateway token even if `CLAUDE_CODE_USE_BEDROCK`, `CLAUDE_CODE_USE_VERTEX`, or `CLAUDE_CODE_USE_FOUNDRY` is set, and credential sources above such as the bearer token, API key, `apiKeyHelper`, and profiles are not used.

259 259 


300 300 

301The command opens the same browser authorization flow as `/login`, and the token prints to the terminal after you approve access in the browser. It does not save the token anywhere; copy it and set it as the `CLAUDE_CODE_OAUTH_TOKEN` environment variable wherever you want to authenticate:301The command opens the same browser authorization flow as `/login`, and the token prints to the terminal after you approve access in the browser. It does not save the token anywhere; copy it and set it as the `CLAUDE_CODE_OAUTH_TOKEN` environment variable wherever you want to authenticate:

302 302 

303**macOS, Linux, WSL**303> [tab] macOS, Linux, WSL

304 304>

305```bash theme={null}305> ```bash theme={null}

306export CLAUDE_CODE_OAUTH_TOKEN=your-token306> export CLAUDE_CODE_OAUTH_TOKEN=your-token

307```307> ```

308 308 

309**Windows PowerShell**309> [tab] Windows PowerShell

310 310>

311```powershell theme={null}311> ```powershell theme={null}

312$env:CLAUDE_CODE_OAUTH_TOKEN = "your-token"312> $env:CLAUDE_CODE_OAUTH_TOKEN = "your-token"

313```313> ```

314 314 

315**Windows CMD**315> [tab] Windows CMD

316 316>

317```batch theme={null}317> ```batch theme={null}

318set CLAUDE_CODE_OAUTH_TOKEN=your-token318> set CLAUDE_CODE_OAUTH_TOKEN=your-token

319```319> ```

320 320 

321This token authenticates with your Claude subscription and requires a Pro, Max, Team, or Enterprise plan. It can only make model requests, so it can't establish [Remote Control](https://code.claude.com/docs/en/remote-control.md) sessions or fetch [claude.ai connectors](https://code.claude.com/docs/en/mcp.md#use-mcp-servers-from-claude-ai). MCP servers you configure locally still work.321This token authenticates with your Claude subscription and requires a Pro, Max, Ultra, Team, or Enterprise plan. It can only make model requests, so it can't establish [Remote Control](https://code.claude.com/docs/en/remote-control.md) sessions or fetch [claude.ai connectors](https://code.claude.com/docs/en/mcp.md#use-mcp-servers-from-claude-ai). MCP servers you configure locally still work.

322 322 

323[Bare mode](https://code.claude.com/docs/en/headless.md#start-faster-with-bare-mode) does not read `CLAUDE_CODE_OAUTH_TOKEN`. If your script passes `--bare`, authenticate with `ANTHROPIC_API_KEY` or an `apiKeyHelper` instead.323[Bare mode](https://code.claude.com/docs/en/headless.md#start-faster-with-bare-mode) does not read `CLAUDE_CODE_OAUTH_TOKEN`. If your script passes `--bare`, authenticate with `ANTHROPIC_API_KEY` or an `apiKeyHelper` instead.

Details

43 43 

44## Why the notice appears44## Why the notice appears

45 45 

46[Server-side classifier review](https://code.claude.com/docs/en/permission-modes.md#server-side-classifier-review) lists which sessions ask the server for the classifier checks. Pro, Max, and Team plans never show the notice. When it appears, the usual causes are:46On a Pro, Max, Ultra, or Team plan, you never see the notice. To find out which sessions ask the server for the classifier checks, see [Server-side classifier review](https://code.claude.com/docs/en/permission-modes.md#server-side-classifier-review). If you see the notice, check for these usual causes:

47 47 

48* **An LLM gateway or proxy is in the path**: one that strips or rewrites request headers, drops request fields it doesn't recognize, or edits responses. The server then never receives the request for checks, or Claude Code never receives the results. When your configuration or the responses identify the gateway, the notice names it.48* **An LLM gateway or proxy is in the path**: one that strips or rewrites request headers, drops request fields it doesn't recognize, or edits responses. The server then never receives the request for checks, or Claude Code never receives the results. When your configuration or the responses identify the gateway, the notice names it.

49* **Server-side checks haven't reached your platform, region, or credential yet**: whether a platform or region performs them depends on that platform's rollout. If you see the notice with no gateway or proxy in the path and it keeps appearing, this is the likely cause. To confirm, contact support or your company's admin, or report it with `/feedback`.49* **Server-side checks haven't reached your platform, region, or credential yet**: whether a platform or region performs them depends on that platform's rollout. If you see the notice with no gateway or proxy in the path and it keeps appearing, this is the likely cause. To confirm, contact support or your company's admin, or report it with `/feedback`.

Details

161 161 

162> [!NOTE]162> [!NOTE]

163>163>

164> `/auto-mode-setup` is available on Pro, Max, Team, and Enterprise plans and with a Claude Console API key. On a Pro, Max, or Team plan, you need v2.1.228 or later, or v2.1.233 or later on native Windows. On an Enterprise plan or with a Claude Console API key, you need v2.1.283 or later. If the command is missing from your session, see [`/auto-mode-setup` returns "Unknown command"](#auto-mode-setup-returns-unknown-command).164> `/auto-mode-setup` is available on Pro, Max, Ultra, Team, and Enterprise plans and with a Claude Console API key. On a Pro, Max, Ultra, or Team plan, you need v2.1.228 or later, or v2.1.233 or later on native Windows. On an Enterprise plan or with a Claude Console API key, you need v2.1.283 or later. If the command is missing from your session, see [`/auto-mode-setup` returns "Unknown command"](#auto-mode-setup-returns-unknown-command).

165 165 

166### What `/auto-mode-setup` reads166### What `/auto-mode-setup` reads

167 167 

Details

489 489 

490With a 1M-token window on most current models and compaction near the top of it, you'll rarely run out of context. You can still *pay* for context you don't need, though. Every request sends the whole conversation, so a session that's collected three unrelated tasks re-reads all three on every turn of the fourth. That's [discounted while the cache is warm](https://code.claude.com/docs/en/costs.md#why-usage-climbs-in-a-long-session) and full price once it expires.490With a 1M-token window on most current models and compaction near the top of it, you'll rarely run out of context. You can still *pay* for context you don't need, though. Every request sends the whole conversation, so a session that's collected three unrelated tasks re-reads all three on every turn of the fourth. That's [discounted while the cache is warm](https://code.claude.com/docs/en/costs.md#why-usage-climbs-in-a-long-session) and full price once it expires.

491 491 

492[`/usage`](https://code.claude.com/docs/en/costs) is the first place to look. On Pro, Max, Team, and Enterprise it breaks your usage down by skill, subagent, plugin, and MCP server. It also flags patterns like long context or frequent cache misses once one of them passes 10% of your usage. From there, the usual fixes:492[`/usage`](https://code.claude.com/docs/en/costs) is the first place to look. On Pro, Max, Ultra, Team, and Enterprise it breaks your usage down by skill, subagent, plugin, and MCP server. It also flags patterns like long context or frequent cache misses once one of them passes 10% of your usage. From there, the usual fixes:

493 493 

494* `/clear` between unrelated tasks. It costs nothing, and it means the next task doesn't keep paying for the previous one's history. `/clear oauth-migration` names the session you're leaving, so you can come back to it later.494* `/clear` between unrelated tasks. It costs nothing, and it means the next task doesn't keep paying for the previous one's history. `/clear oauth-migration` names the session you're leaving, so you can come back to it later.

495* `/compact` with a focus, like `/compact keep the API changes and the test commands`. On a long session `/compact` is itself a big request, since it reads the whole conversation to summarize it, and even more so once the cache has expired.495* `/compact` with a focus, like `/compact keep the API changes and the test commands`. On a long session `/compact` is itself a big request, since it reads the whole conversation to summarize it, and even more so once the cache has expired.

channels.md +189 −189

Details

24 24 

25Each supported channel is a plugin that requires [Bun](https://bun.sh). For a hands-on demo of the plugin flow before connecting a real platform, try the [fakechat quickstart](#quickstart).25Each supported channel is a plugin that requires [Bun](https://bun.sh). For a hands-on demo of the plugin flow before connecting a real platform, try the [fakechat quickstart](#quickstart).

26 26 

27**Telegram**27> [tab] Telegram

28 

29View the full [Telegram plugin source](https://github.com/anthropics/claude-plugins-official/tree/main/external_plugins/telegram).

30 

31**1. Create a Telegram bot**

32 

33Open [BotFather](https://t.me/BotFather) in Telegram and send `/newbot`. Give it a display name and a unique username ending in `bot`. Copy the token BotFather returns.

34 

35**2. Install the plugin**

36 

37Start Claude Code by running `claude` in your terminal, then enter this at its prompt:

38 

39```

40/plugin install telegram@claude-plugins-official

41```

42 

43If the install fails, match the message Claude Code reports:

44 

45* `Marketplace "claude-plugins-official" not found`: add the marketplace with `/plugin marketplace add anthropics/claude-plugins-official`, then retry the install.

46* `Plugin "<name>" not found in marketplace "claude-plugins-official"`: your local copy of the marketplace catalog may be out of date. Refresh it with `/plugin marketplace update claude-plugins-official`, then retry the install. If the retry prints the same message, see [Plugin not found in marketplace](https://code.claude.com/docs/en/plugins/troubleshooting.md#plugin-not-found-in-marketplace).

47 

48When the install asks for an installation scope, choose the user scope option so the plugin is available across all your projects. Check the install summary: if it reports `Run /reload-plugins to apply.`, see [Apply plugin changes without restarting](https://code.claude.com/docs/en/plugins/cli-reference.md#reload-plugins) to make the plugin's configure command available.

49 

50**3. Configure your token**

51 

52Run the configure command with the token from BotFather:

53 

54```

55/telegram:configure <token>

56```

57 

58This saves it to `~/.claude/channels/telegram/.env`. You can also set `TELEGRAM_BOT_TOKEN` in your shell environment before launching Claude Code.

59 

60**4. Restart with channels enabled**

61 

62Exit Claude Code and restart with the channel flag. This starts the Telegram plugin, which begins polling for messages from your bot:

63 

64```bash theme={null}

65claude --channels plugin:telegram@claude-plugins-official

66```

67 

68**5. Pair your account**

69 

70Open Telegram and send any message to your bot. The bot replies with a pairing code.

71 

72> [!NOTE]

73>28>

74> If your bot doesn't respond, make sure Claude Code is running with `--channels` from the previous step. The bot can only reply while the channel is active.29> View the full [Telegram plugin source](https://github.com/anthropics/claude-plugins-official/tree/main/external_plugins/telegram).

75 

76Back in Claude Code, run:

77 

78```

79/telegram:access pair <code>

80```

81 

82Then lock down access so only your account can send messages:

83 

84```

85/telegram:access policy allowlist

86```

87 

88**Discord**

89 

90View the full [Discord plugin source](https://github.com/anthropics/claude-plugins-official/tree/main/external_plugins/discord).

91 

92**1. Create a Discord bot**

93 

94Go to the [Discord Developer Portal](https://discord.com/developers/applications), click **New Application**, and name it. In the **Bot** section, create a username, then click **Reset Token** and copy the token.

95 

96**2. Enable Message Content Intent**

97 

98In your bot's settings, scroll to **Privileged Gateway Intents** and enable **Message Content Intent**.

99 

100**3. Invite the bot to your server**

101 

102Go to **OAuth2 > URL Generator**. Select the `bot` scope and enable these permissions:

103 

104* View Channels

105* Send Messages

106* Send Messages in Threads

107* Read Message History

108* Attach Files

109* Add Reactions

110 

111Open the generated URL to add the bot to your server.

112 

113**4. Install the plugin**

114 

115Start Claude Code by running `claude` in your terminal, then enter this at its prompt:

116 

117```

118/plugin install discord@claude-plugins-official

119```

120 

121If the install fails, match the message Claude Code reports:

122 

123* `Marketplace "claude-plugins-official" not found`: add the marketplace with `/plugin marketplace add anthropics/claude-plugins-official`, then retry the install.

124* `Plugin "<name>" not found in marketplace "claude-plugins-official"`: your local copy of the marketplace catalog may be out of date. Refresh it with `/plugin marketplace update claude-plugins-official`, then retry the install. If the retry prints the same message, see [Plugin not found in marketplace](https://code.claude.com/docs/en/plugins/troubleshooting.md#plugin-not-found-in-marketplace).

125 

126When the install asks for an installation scope, choose the user scope option so the plugin is available across all your projects. Check the install summary: if it reports `Run /reload-plugins to apply.`, see [Apply plugin changes without restarting](https://code.claude.com/docs/en/plugins/cli-reference.md#reload-plugins) to make the plugin's configure command available.

127 

128**5. Configure your token**

129 

130Run the configure command with the bot token you copied:

131 

132```

133/discord:configure <token>

134```

135 

136This saves it to `~/.claude/channels/discord/.env`. You can also set `DISCORD_BOT_TOKEN` in your shell environment before launching Claude Code.

137 

138**6. Restart with channels enabled**

139 

140Exit Claude Code and restart with the channel flag. This connects the Discord plugin so your bot can receive and respond to messages:

141 

142```bash theme={null}

143claude --channels plugin:discord@claude-plugins-official

144```

145 

146**7. Pair your account**

147 

148DM your bot on Discord. The bot replies with a pairing code.

149 

150> [!NOTE]

151>30>

152> If your bot doesn't respond, make sure Claude Code is running with `--channels` from the previous step. The bot can only reply while the channel is active.31> **1. Create a Telegram bot**

153 

154Back in Claude Code, run:

155 

156```

157/discord:access pair <code>

158```

159 

160Then lock down access so only your account can send messages:

161 

162```

163/discord:access policy allowlist

164```

165 

166**iMessage**

167 

168View the full [iMessage plugin source](https://github.com/anthropics/claude-plugins-official/tree/main/external_plugins/imessage).

169 

170The iMessage channel reads your Messages database directly and sends replies through AppleScript. It requires macOS and needs no bot token or external service.

171 

172**1. Grant Full Disk Access**

173 

174The Messages database at `~/Library/Messages/chat.db` is protected by macOS. The first time the server reads it, macOS prompts for access: click **Allow**. The prompt names whichever app launched Bun, such as Terminal, iTerm, or your IDE.

175 

176If the prompt doesn't appear or you clicked Don't Allow, grant access manually under **System Settings > Privacy & Security > Full Disk Access** and add your terminal. Without this, the server exits immediately with `authorization denied`.

177 

178**2. Install the plugin**

179 

180Start Claude Code by running `claude` in your terminal, then enter this at its prompt:

181 

182```

183/plugin install imessage@claude-plugins-official

184```

185 

186If the install fails, match the message Claude Code reports:

187 

188* `Marketplace "claude-plugins-official" not found`: add the marketplace with `/plugin marketplace add anthropics/claude-plugins-official`, then retry the install.

189* `Plugin "<name>" not found in marketplace "claude-plugins-official"`: your local copy of the marketplace catalog may be out of date. Refresh it with `/plugin marketplace update claude-plugins-official`, then retry the install. If the retry prints the same message, see [Plugin not found in marketplace](https://code.claude.com/docs/en/plugins/troubleshooting.md#plugin-not-found-in-marketplace).

190 

191When the install asks for an installation scope, choose the user scope option so the plugin is available across all your projects.

192 

193If the install summary reports `Run /reload-plugins to apply.`, you don't need to act on it here, because restarting in the next step picks up the plugin.

194 

195**3. Restart with channels enabled**

196 

197Exit Claude Code and restart with the channel flag:

198 

199```bash theme={null}

200claude --channels plugin:imessage@claude-plugins-official

201```

202 

203**4. Text yourself**

204 

205Open Messages on any device signed into your Apple ID and send a message to yourself. It reaches Claude immediately: self-chat bypasses access control with no setup.

206 

207> [!NOTE]

208>32>

209> The first reply Claude sends triggers a macOS Automation prompt asking if your terminal can control Messages. Click **OK**.33> Open [BotFather](https://t.me/BotFather) in Telegram and send `/newbot`. Give it a display name and a unique username ending in `bot`. Copy the token BotFather returns.

210 34>

211**5. Allow other senders**35> **2. Install the plugin**

212 36>

213By default, only your own messages pass through. To let another contact reach Claude, add their handle:37> Start Claude Code by running `claude` in your terminal, then enter this at its prompt:

38>

39> ```

40> /plugin install telegram@claude-plugins-official

41> ```

42>

43> If the install fails, match the message Claude Code reports:

44>

45> * `Marketplace "claude-plugins-official" not found`: add the marketplace with `/plugin marketplace add anthropics/claude-plugins-official`, then retry the install.

46> * `Plugin "<name>" not found in marketplace "claude-plugins-official"`: your local copy of the marketplace catalog may be out of date. Refresh it with `/plugin marketplace update claude-plugins-official`, then retry the install. If the retry prints the same message, see [Plugin not found in marketplace](https://code.claude.com/docs/en/plugins/troubleshooting.md#plugin-not-found-in-marketplace).

47>

48> When the install asks for an installation scope, choose the user scope option so the plugin is available across all your projects. Check the install summary: if it reports `Run /reload-plugins to apply.`, see [Apply plugin changes without restarting](https://code.claude.com/docs/en/plugins/cli-reference.md#reload-plugins) to make the plugin's configure command available.

49>

50> **3. Configure your token**

51>

52> Run the configure command with the token from BotFather:

53>

54> ```

55> /telegram:configure <token>

56> ```

57>

58> This saves it to `~/.claude/channels/telegram/.env`. You can also set `TELEGRAM_BOT_TOKEN` in your shell environment before launching Claude Code.

59>

60> **4. Restart with channels enabled**

61>

62> Exit Claude Code and restart with the channel flag. This starts the Telegram plugin, which begins polling for messages from your bot:

63>

64> ```bash theme={null}

65> claude --channels plugin:telegram@claude-plugins-official

66> ```

67>

68> **5. Pair your account**

69>

70> Open Telegram and send any message to your bot. The bot replies with a pairing code.

71>

72> > [!NOTE]

73> >

74> > If your bot doesn't respond, make sure Claude Code is running with `--channels` from the previous step. The bot can only reply while the channel is active.

75>

76> Back in Claude Code, run:

77>

78> ```

79> /telegram:access pair <code>

80> ```

81>

82> Then lock down access so only your account can send messages:

83>

84> ```

85> /telegram:access policy allowlist

86> ```

214 87 

215```88> [tab] Discord

216/imessage:access allow +1555123456789>

217```90> View the full [Discord plugin source](https://github.com/anthropics/claude-plugins-official/tree/main/external_plugins/discord).

91>

92> **1. Create a Discord bot**

93>

94> Go to the [Discord Developer Portal](https://discord.com/developers/applications), click **New Application**, and name it. In the **Bot** section, create a username, then click **Reset Token** and copy the token.

95>

96> **2. Enable Message Content Intent**

97>

98> In your bot's settings, scroll to **Privileged Gateway Intents** and enable **Message Content Intent**.

99>

100> **3. Invite the bot to your server**

101>

102> Go to **OAuth2 > URL Generator**. Select the `bot` scope and enable these permissions:

103>

104> * View Channels

105> * Send Messages

106> * Send Messages in Threads

107> * Read Message History

108> * Attach Files

109> * Add Reactions

110>

111> Open the generated URL to add the bot to your server.

112>

113> **4. Install the plugin**

114>

115> Start Claude Code by running `claude` in your terminal, then enter this at its prompt:

116>

117> ```

118> /plugin install discord@claude-plugins-official

119> ```

120>

121> If the install fails, match the message Claude Code reports:

122>

123> * `Marketplace "claude-plugins-official" not found`: add the marketplace with `/plugin marketplace add anthropics/claude-plugins-official`, then retry the install.

124> * `Plugin "<name>" not found in marketplace "claude-plugins-official"`: your local copy of the marketplace catalog may be out of date. Refresh it with `/plugin marketplace update claude-plugins-official`, then retry the install. If the retry prints the same message, see [Plugin not found in marketplace](https://code.claude.com/docs/en/plugins/troubleshooting.md#plugin-not-found-in-marketplace).

125>

126> When the install asks for an installation scope, choose the user scope option so the plugin is available across all your projects. Check the install summary: if it reports `Run /reload-plugins to apply.`, see [Apply plugin changes without restarting](https://code.claude.com/docs/en/plugins/cli-reference.md#reload-plugins) to make the plugin's configure command available.

127>

128> **5. Configure your token**

129>

130> Run the configure command with the bot token you copied:

131>

132> ```

133> /discord:configure <token>

134> ```

135>

136> This saves it to `~/.claude/channels/discord/.env`. You can also set `DISCORD_BOT_TOKEN` in your shell environment before launching Claude Code.

137>

138> **6. Restart with channels enabled**

139>

140> Exit Claude Code and restart with the channel flag. This connects the Discord plugin so your bot can receive and respond to messages:

141>

142> ```bash theme={null}

143> claude --channels plugin:discord@claude-plugins-official

144> ```

145>

146> **7. Pair your account**

147>

148> DM your bot on Discord. The bot replies with a pairing code.

149>

150> > [!NOTE]

151> >

152> > If your bot doesn't respond, make sure Claude Code is running with `--channels` from the previous step. The bot can only reply while the channel is active.

153>

154> Back in Claude Code, run:

155>

156> ```

157> /discord:access pair <code>

158> ```

159>

160> Then lock down access so only your account can send messages:

161>

162> ```

163> /discord:access policy allowlist

164> ```

218 165 

219Handles are phone numbers in `+country` format or Apple ID emails like `user@example.com`.166> [tab] iMessage

167>

168> View the full [iMessage plugin source](https://github.com/anthropics/claude-plugins-official/tree/main/external_plugins/imessage).

169>

170> The iMessage channel reads your Messages database directly and sends replies through AppleScript. It requires macOS and needs no bot token or external service.

171>

172> **1. Grant Full Disk Access**

173>

174> The Messages database at `~/Library/Messages/chat.db` is protected by macOS. The first time the server reads it, macOS prompts for access: click **Allow**. The prompt names whichever app launched Bun, such as Terminal, iTerm, or your IDE.

175>

176> If the prompt doesn't appear or you clicked Don't Allow, grant access manually under **System Settings > Privacy & Security > Full Disk Access** and add your terminal. Without this, the server exits immediately with `authorization denied`.

177>

178> **2. Install the plugin**

179>

180> Start Claude Code by running `claude` in your terminal, then enter this at its prompt:

181>

182> ```

183> /plugin install imessage@claude-plugins-official

184> ```

185>

186> If the install fails, match the message Claude Code reports:

187>

188> * `Marketplace "claude-plugins-official" not found`: add the marketplace with `/plugin marketplace add anthropics/claude-plugins-official`, then retry the install.

189> * `Plugin "<name>" not found in marketplace "claude-plugins-official"`: your local copy of the marketplace catalog may be out of date. Refresh it with `/plugin marketplace update claude-plugins-official`, then retry the install. If the retry prints the same message, see [Plugin not found in marketplace](https://code.claude.com/docs/en/plugins/troubleshooting.md#plugin-not-found-in-marketplace).

190>

191> When the install asks for an installation scope, choose the user scope option so the plugin is available across all your projects.

192>

193> If the install summary reports `Run /reload-plugins to apply.`, you don't need to act on it here, because restarting in the next step picks up the plugin.

194>

195> **3. Restart with channels enabled**

196>

197> Exit Claude Code and restart with the channel flag:

198>

199> ```bash theme={null}

200> claude --channels plugin:imessage@claude-plugins-official

201> ```

202>

203> **4. Text yourself**

204>

205> Open Messages on any device signed into your Apple ID and send a message to yourself. It reaches Claude immediately: self-chat bypasses access control with no setup.

206>

207> > [!NOTE]

208> >

209> > The first reply Claude sends triggers a macOS Automation prompt asking if your terminal can control Messages. Click **OK**.

210>

211> **5. Allow other senders**

212>

213> By default, only your own messages pass through. To let another contact reach Claude, add their handle:

214>

215> ```

216> /imessage:access allow +15551234567

217> ```

218>

219> Handles are phone numbers in `+country` format or Apple ID emails like `user@example.com`.

220 220 

221## Quickstart221## Quickstart

222 222 


308| `channelsEnabled` | Master switch. Must be `true` for any channel to deliver messages. Blocks all channels including the development flag when off. See [Enable channels for your organization](#enable-channels-for-your-organization). | claude.ai Team and Enterprise: channels blocked. Console: channels allowed unless your organization deploys managed settings, in which case channels are blocked until this key is set |308| `channelsEnabled` | Master switch. Must be `true` for any channel to deliver messages. Blocks all channels including the development flag when off. See [Enable channels for your organization](#enable-channels-for-your-organization). | claude.ai Team and Enterprise: channels blocked. Console: channels allowed unless your organization deploys managed settings, in which case channels are blocked until this key is set |

309| `allowedChannelPlugins` | Which plugins can register once channels are enabled. Replaces the Anthropic-maintained list when set. | Anthropic default list applies |309| `allowedChannelPlugins` | Which plugins can register once channels are enabled. Replaces the Anthropic-maintained list when set. | Anthropic default list applies |

310 310 

311Pro and Max users without an organization skip these checks entirely: channels are available and users opt in per session with `--channels`.311Pro, Max, and Ultra users without an organization skip these checks entirely: channels are available and users opt in per session with `--channels`.

312 312 

313### Enable channels for your organization313### Enable channels for your organization

314 314 

chrome.md +1 −1

Details

39* [Google Chrome](https://www.google.com/chrome/), [Microsoft Edge](https://www.microsoft.com/edge), or another Chromium-based browser such as Brave, Arc, Vivaldi, or Opera39* [Google Chrome](https://www.google.com/chrome/), [Microsoft Edge](https://www.microsoft.com/edge), or another Chromium-based browser such as Brave, Arc, Vivaldi, or Opera

40* [Claude in Chrome extension](https://chromewebstore.google.com/detail/claude/fcoeoabgfenejglbffodgkkbkcdhcgfn) version 1.0.36 or later, available in the Chrome Web Store40* [Claude in Chrome extension](https://chromewebstore.google.com/detail/claude/fcoeoabgfenejglbffodgkkbkcdhcgfn) version 1.0.36 or later, available in the Chrome Web Store

41* [Claude Code](https://code.claude.com/docs/en/quickstart.md#step-1-install-claude-code)41* [Claude Code](https://code.claude.com/docs/en/quickstart.md#step-1-install-claude-code)

42* A direct Anthropic plan (Pro, Max, Team, or Enterprise)42* A direct Anthropic plan (Pro, Max, Ultra, Team, or Enterprise)

43 43 

44In Enterprise organizations that have HIPAA enabled, Claude in Chrome is off by default, and an [Owner](https://code.claude.com/docs/en/server-managed-settings.md#access-control) can turn it on in [**Organization settings > Claude in Chrome**](https://claude.ai/admin-settings/browser-extension). Your Business Associate Agreement (BAA) with Anthropic doesn't cover data sent to third-party sites through Claude in Chrome. See the [Implementation Guide](https://trust.anthropic.com/resources?s=l1wrssd9hsbi4gak0tp5a6\&name=%5Banthropic%5D-hipaa-ready-offering-implementation-guide) for a list of Eligible Services.44In Enterprise organizations that have HIPAA enabled, Claude in Chrome is off by default, and an [Owner](https://code.claude.com/docs/en/server-managed-settings.md#access-control) can turn it on in [**Organization settings > Claude in Chrome**](https://claude.ai/admin-settings/browser-extension). Your Business Associate Agreement (BAA) with Anthropic doesn't cover data sent to third-party sites through Claude in Chrome. See the [Implementation Guide](https://trust.anthropic.com/resources?s=l1wrssd9hsbi4gak0tp5a6\&name=%5Banthropic%5D-hipaa-ready-offering-implementation-guide) for a list of Eligible Services.

45 45 

Details

325 325 

326**7. Deploy**326**7. Deploy**

327 327 

328**ECS Fargate**328> [tab] ECS Fargate

329 329>

330Create the cluster and a log group for the gateway's stderr, which carries both its audit events and operational logs. Retention is a separate call, and without one CloudWatch keeps the logs forever; align the 90 days with your audit retention policy:330> Create the cluster and a log group for the gateway's stderr, which carries both its audit events and operational logs. Retention is a separate call, and without one CloudWatch keeps the logs forever; align the 90 days with your audit retention policy:

331 331>

332```bash theme={null}332> ```bash theme={null}

333aws ecs create-cluster --cluster-name claude-gateway333> aws ecs create-cluster --cluster-name claude-gateway

334aws logs create-log-group --log-group-name /ecs/claude-gateway334> aws logs create-log-group --log-group-name /ecs/claude-gateway

335aws logs put-retention-policy --log-group-name /ecs/claude-gateway \335> aws logs put-retention-policy --log-group-name /ecs/claude-gateway \

336 --retention-in-days 90336> --retention-in-days 90

337```337> ```

338 338>

339Write the task definition. The task role carries the Bedrock permission and the execution role injects the secrets; use the secret ARNs from the Secrets Manager step:339> Write the task definition. The task role carries the Bedrock permission and the execution role injects the secrets; use the secret ARNs from the Secrets Manager step:

340 340>

341```json claude-gateway-task.json theme={null}341> ```json claude-gateway-task.json theme={null}

342{342> {

343 "family": "claude-gateway",343> "family": "claude-gateway",

344 "networkMode": "awsvpc",344> "networkMode": "awsvpc",

345 "requiresCompatibilities": ["FARGATE"],345> "requiresCompatibilities": ["FARGATE"],

346 "cpu": "1024",346> "cpu": "1024",

347 "memory": "2048",347> "memory": "2048",

348 "runtimePlatform": { "cpuArchitecture": "X86_64", "operatingSystemFamily": "LINUX" },348> "runtimePlatform": { "cpuArchitecture": "X86_64", "operatingSystemFamily": "LINUX" },

349 "executionRoleArn": "arn:aws:iam::<account-id>:role/claude-gateway-execution",349> "executionRoleArn": "arn:aws:iam::<account-id>:role/claude-gateway-execution",

350 "taskRoleArn": "arn:aws:iam::<account-id>:role/claude-gateway-task",350> "taskRoleArn": "arn:aws:iam::<account-id>:role/claude-gateway-task",

351 "containerDefinitions": [351> "containerDefinitions": [

352 {352> {

353 "name": "gateway",353> "name": "gateway",

354 "image": "<account-id>.dkr.ecr.<region>.amazonaws.com/claude-gateway:<version>",354> "image": "<account-id>.dkr.ecr.<region>.amazonaws.com/claude-gateway:<version>",

355 "portMappings": [{ "containerPort": 8080 }],355> "portMappings": [{ "containerPort": 8080 }],

356 "secrets": [356> "secrets": [

357 { "name": "GATEWAY_JWT_SECRET", "valueFrom": "<gateway-jwt-secret ARN>" },357> { "name": "GATEWAY_JWT_SECRET", "valueFrom": "<gateway-jwt-secret ARN>" },

358 { "name": "OIDC_CLIENT_SECRET", "valueFrom": "<gateway-oidc-client-secret ARN>" },358> { "name": "OIDC_CLIENT_SECRET", "valueFrom": "<gateway-oidc-client-secret ARN>" },

359 { "name": "GATEWAY_POSTGRES_URL", "valueFrom": "<gateway-postgres-url ARN>" }359> { "name": "GATEWAY_POSTGRES_URL", "valueFrom": "<gateway-postgres-url ARN>" }

360 ],360> ],

361 "logConfiguration": {361> "logConfiguration": {

362 "logDriver": "awslogs",362> "logDriver": "awslogs",

363 "options": {363> "options": {

364 "awslogs-group": "/ecs/claude-gateway",364> "awslogs-group": "/ecs/claude-gateway",

365 "awslogs-region": "<region>",365> "awslogs-region": "<region>",

366 "awslogs-stream-prefix": "gateway"366> "awslogs-stream-prefix": "gateway"

367 }367> }

368 }368> }

369 }369> }

370 ]370> ]

371}371> }

372```372> ```

373 373>

374Register it:374> Register it:

375 375>

376```bash theme={null}376> ```bash theme={null}

377aws ecs register-task-definition --cli-input-json file://claude-gateway-task.json377> aws ecs register-task-definition --cli-input-json file://claude-gateway-task.json

378```378> ```

379 379>

380Put an internal ALB in front with a target group that health-checks the gateway. `--ip-address-type ipv4` matters: an internal dual-stack ALB publishes public-range AAAA records, which the `/login` private-network check rejects:380> Put an internal ALB in front with a target group that health-checks the gateway. `--ip-address-type ipv4` matters: an internal dual-stack ALB publishes public-range AAAA records, which the `/login` private-network check rejects:

381 381>

382```bash theme={null}382> ```bash theme={null}

383ALB_ARN="$(aws elbv2 create-load-balancer --name claude-gateway \383> ALB_ARN="$(aws elbv2 create-load-balancer --name claude-gateway \

384 --scheme internal --type application --ip-address-type ipv4 \384> --scheme internal --type application --ip-address-type ipv4 \

385 --subnets $PRIVATE_SUBNETS --security-groups "$ALB_SG" \385> --subnets $PRIVATE_SUBNETS --security-groups "$ALB_SG" \

386 --query 'LoadBalancers[0].LoadBalancerArn' --output text)"386> --query 'LoadBalancers[0].LoadBalancerArn' --output text)"

387 387>

388TG_ARN="$(aws elbv2 create-target-group --name claude-gateway \388> TG_ARN="$(aws elbv2 create-target-group --name claude-gateway \

389 --protocol HTTP --port 8080 --vpc-id "$VPC_ID" --target-type ip \389> --protocol HTTP --port 8080 --vpc-id "$VPC_ID" --target-type ip \

390 --health-check-path /readyz \390> --health-check-path /readyz \

391 --query 'TargetGroups[0].TargetGroupArn' --output text)"391> --query 'TargetGroups[0].TargetGroupArn' --output text)"

392```392> ```

393 393>

394Add the HTTPS listener. `--ssl-policy` pins a modern TLS floor, since omitting it falls back to the legacy `ELBSecurityPolicy-2016-08` default, which still accepts TLS 1.0/1.1.394> Add the HTTPS listener. `--ssl-policy` pins a modern TLS floor, since omitting it falls back to the legacy `ELBSecurityPolicy-2016-08` default, which still accepts TLS 1.0/1.1.

395 395>

396The ALB closes a connection after 60 seconds with no data by default. The gateway's keepalive pings keep streams inside that default, so raising the timeout adds margin above the ping cadence; the [Troubleshooting](#troubleshooting) row on dropped streams covers the mechanism and older gateways. The commands below add the listener and raise the timeout:396> The ALB closes a connection after 60 seconds with no data by default. The gateway's keepalive pings keep streams inside that default, so raising the timeout adds margin above the ping cadence; the [Troubleshooting](#troubleshooting) row on dropped streams covers the mechanism and older gateways. The commands below add the listener and raise the timeout:

397 397>

398```bash theme={null}398> ```bash theme={null}

399aws elbv2 create-listener --load-balancer-arn "$ALB_ARN" \399> aws elbv2 create-listener --load-balancer-arn "$ALB_ARN" \

400 --protocol HTTPS --port 443 \400> --protocol HTTPS --port 443 \

401 --ssl-policy ELBSecurityPolicy-TLS13-1-2-2021-06 \401> --ssl-policy ELBSecurityPolicy-TLS13-1-2-2021-06 \

402 --certificates CertificateArn=<your-acm-certificate-arn> \402> --certificates CertificateArn=<your-acm-certificate-arn> \

403 --default-actions Type=forward,TargetGroupArn="$TG_ARN"403> --default-actions Type=forward,TargetGroupArn="$TG_ARN"

404 404>

405aws elbv2 modify-load-balancer-attributes --load-balancer-arn "$ALB_ARN" \405> aws elbv2 modify-load-balancer-attributes --load-balancer-arn "$ALB_ARN" \

406 --attributes Key=idle_timeout.timeout_seconds,Value=3600406> --attributes Key=idle_timeout.timeout_seconds,Value=3600

407```407> ```

408 408>

409Create the service. The deployment circuit breaker rolls a deployment whose tasks keep failing, from a bad image or an unbootable config, back to the last steady state instead of relaunching failing tasks forever:409> Create the service. The deployment circuit breaker rolls a deployment whose tasks keep failing, from a bad image or an unbootable config, back to the last steady state instead of relaunching failing tasks forever:

410 410>

411```bash theme={null}411> ```bash theme={null}

412aws ecs create-service --cluster claude-gateway --service-name claude-gateway \412> aws ecs create-service --cluster claude-gateway --service-name claude-gateway \

413 --task-definition claude-gateway --desired-count 1 --launch-type FARGATE \413> --task-definition claude-gateway --desired-count 1 --launch-type FARGATE \

414 --deployment-configuration "deploymentCircuitBreaker={enable=true,rollback=true}" \414> --deployment-configuration "deploymentCircuitBreaker={enable=true,rollback=true}" \

415 --health-check-grace-period-seconds 60 \415> --health-check-grace-period-seconds 60 \

416 --network-configuration "awsvpcConfiguration={subnets=[$(echo $PRIVATE_SUBNETS | tr ' ' ',')],securityGroups=[$GW_SG],assignPublicIp=DISABLED}" \416> --network-configuration "awsvpcConfiguration={subnets=[$(echo $PRIVATE_SUBNETS | tr ' ' ',')],securityGroups=[$GW_SG],assignPublicIp=DISABLED}" \

417 --load-balancers "targetGroupArn=$TG_ARN,containerName=gateway,containerPort=8080"417> --load-balancers "targetGroupArn=$TG_ARN,containerName=gateway,containerPort=8080"

418```418> ```

419 419>

420The 60-second grace period gives a cold task time to pull the image, connect to the store, and answer its first health check before ECS starts counting failures against the deployment.420> The 60-second grace period gives a cold task time to pull the image, connect to the store, and answer its first health check before ECS starts counting failures against the deployment.

421 421>

422The target group's health check on `GET /readyz` verifies the store is reachable, so a task that can't reach Postgres never enters rotation. To keep tasks passing the check through a short database outage such as an RDS failover, set `store.readiness_grace_seconds` as described in [Outage behavior](https://code.claude.com/docs/en/claude-apps-gateway-deploy.md#outage-behavior), which also covers the `/healthz` alternative.422> The target group's health check on `GET /readyz` verifies the store is reachable, so a task that can't reach Postgres never enters rotation. To keep tasks passing the check through a short database outage such as an RDS failover, set `store.readiness_grace_seconds` as described in [Outage behavior](https://code.claude.com/docs/en/claude-apps-gateway-deploy.md#outage-behavior), which also covers the `/healthz` alternative.

423 423>

424The tasks run in private subnets with no public IP, so all egress (to Bedrock, your IdP, Secrets Manager, ECR, and CloudWatch Logs) goes through the NAT gateway. To keep Bedrock traffic off the public path, create a `bedrock-runtime` interface VPC endpoint and point the upstream's `base_url` at it, as shown in the [Bedrock upstream reference](https://code.claude.com/docs/en/claude-apps-gateway-config.md#amazon-bedrock); the IdP still needs internet egress.424> The tasks run in private subnets with no public IP, so all egress (to Bedrock, your IdP, Secrets Manager, ECR, and CloudWatch Logs) goes through the NAT gateway. To keep Bedrock traffic off the public path, create a `bedrock-runtime` interface VPC endpoint and point the upstream's `base_url` at it, as shown in the [Bedrock upstream reference](https://code.claude.com/docs/en/claude-apps-gateway-config.md#amazon-bedrock); the IdP still needs internet egress.

425 425>

426Finish by giving developers a privately resolvable hostname: in a Route 53 private hosted zone, alias the gateway's internal DNS name to the ALB, and set `listen.public_url` to that hostname. The ALB's own `*.elb.amazonaws.com` name resolves to private addresses on an internal ALB, but it can't carry your ACM certificate, so use your own name.426> Finish by giving developers a privately resolvable hostname: in a Route 53 private hosted zone, alias the gateway's internal DNS name to the ALB, and set `listen.public_url` to that hostname. The ALB's own `*.elb.amazonaws.com` name resolves to private addresses on an internal ALB, but it can't carry your ACM certificate, so use your own name.

427 427>

428Update the OAuth client's authorized redirect URI to `<public_url>/oauth/callback` before the first sign-in. After changing `public_url`, rebuild and push the image under a new tag, register a new task definition revision, and redeploy. On ECS the setting lives in the image's embedded `gateway.yaml`, and the gateway builds its public origin only from that setting, ignoring `X-Forwarded-Host` and `X-Forwarded-Proto`. `X-Forwarded-For` is honored for client IPs only when `listen.trusted_proxies` is set.428> Update the OAuth client's authorized redirect URI to `<public_url>/oauth/callback` before the first sign-in. After changing `public_url`, rebuild and push the image under a new tag, register a new task definition revision, and redeploy. On ECS the setting lives in the image's embedded `gateway.yaml`, and the gateway builds its public origin only from that setting, ignoring `X-Forwarded-Host` and `X-Forwarded-Proto`. `X-Forwarded-For` is honored for client IPs only when `listen.trusted_proxies` is set.

429 

430**EKS**

431 

432This track needs `kubectl` and `eksctl` installed locally, and an existing EKS cluster with an IAM OIDC provider and the AWS Load Balancer Controller installed. The cluster must be on `$VPC_ID` so pods can reach the RDS private endpoint, and the `claude-gateway-db` security group must admit the cluster's pod or node security group in place of `$GW_SG`.

433 

434On EKS the gateway gets its Bedrock credentials through IRSA rather than the ECS roles. The `ecs-tasks.amazonaws.com` trust policy from the IAM step does not apply here; IRSA needs a role whose trust policy federates on the cluster's OIDC provider, scoped to `system:serviceaccount:claude-gateway:gateway`. `eksctl create iamserviceaccount` creates that role, attaches the policies, and annotates the Kubernetes service account with the role ARN in one step. Turn the two policy documents from the IAM step into managed policies it can attach:

435 

436```bash theme={null}

437BEDROCK_POLICY_ARN="$(aws iam create-policy --policy-name claude-gateway-bedrock-invoke \

438 --policy-document file://bedrock-invoke.json --query Policy.Arn --output text)"

439SECRETS_POLICY_ARN="$(aws iam create-policy --policy-name claude-gateway-secrets-read \

440 --policy-document file://secrets-read.json --query Policy.Arn --output text)"

441 

442kubectl create namespace claude-gateway

443eksctl create iamserviceaccount --cluster <your-cluster> --region "$AWS_REGION" \

444 --namespace claude-gateway --name gateway --role-name claude-gateway \

445 --attach-policy-arn "$BEDROCK_POLICY_ARN" \

446 --attach-policy-arn "$SECRETS_POLICY_ARN" \

447 --approve

448```

449 

450The secrets policy is needed only when the pods read Secrets Manager themselves, as the Secrets Store CSI driver's AWS provider does using the mounting pod's service account; drop it if you create the Kubernetes Secrets another way. The provider needs both of the policy's actions: it calls `DescribeSecret` when it reconciles rotated secrets, so a `GetSecretValue`-only grant mounts on the first deploy but stops picking up rotations.

451 

452Deploy the gateway as a standard Deployment plus a Service and an Ingress, as described in [Kubernetes deployment](https://code.claude.com/docs/en/claude-apps-gateway-deploy.md#kubernetes), with:

453 

454* `serviceAccountName: gateway`

455* `gateway.yaml` mounted from a ConfigMap and the secrets mounted at `/secrets`

456* the readiness probe pointed at `GET /readyz`

457 

458For the front end, an Ingress managed by the AWS Load Balancer Controller provisions the internal ALB. Annotate it with:

459 

460* `alb.ingress.kubernetes.io/scheme: internal` and `alb.ingress.kubernetes.io/target-type: ip`

461* `alb.ingress.kubernetes.io/ip-address-type: ipv4`, so no public-range AAAA records are published for the `/login` [private-network check](https://code.claude.com/docs/en/claude-apps-gateway#prerequisites) to reject

462* `alb.ingress.kubernetes.io/inbound-cidrs: <your-corporate-cidr>`, so the controller-managed frontend security group admits only your corporate network in place of its `0.0.0.0/0` default

463* `alb.ingress.kubernetes.io/certificate-arn` with the ACM certificate

464* `alb.ingress.kubernetes.io/ssl-policy: ELBSecurityPolicy-TLS13-1-2-2021-06`, so the listener doesn't fall back to the legacy default policy that accepts TLS 1.0 and 1.1

465* `alb.ingress.kubernetes.io/load-balancer-attributes: idle_timeout.timeout_seconds=3600`, a margin above the gateway's streaming keepalive; see [Troubleshooting](#troubleshooting)

466 429 

467With IRSA, the AWS SDK reads a projected service-account token and exchanges it with AWS STS, so the pod never needs the EC2 instance metadata service; an egress NetworkPolicy may block `169.254.169.254` for gateway pods. The node hop-limit problem in [Troubleshooting](#troubleshooting) below applies only to clusters that skip IRSA and rely on node instance roles.430> [tab] EKS

431>

432> This track needs `kubectl` and `eksctl` installed locally, and an existing EKS cluster with an IAM OIDC provider and the AWS Load Balancer Controller installed. The cluster must be on `$VPC_ID` so pods can reach the RDS private endpoint, and the `claude-gateway-db` security group must admit the cluster's pod or node security group in place of `$GW_SG`.

433>

434> On EKS the gateway gets its Bedrock credentials through IRSA rather than the ECS roles. The `ecs-tasks.amazonaws.com` trust policy from the IAM step does not apply here; IRSA needs a role whose trust policy federates on the cluster's OIDC provider, scoped to `system:serviceaccount:claude-gateway:gateway`. `eksctl create iamserviceaccount` creates that role, attaches the policies, and annotates the Kubernetes service account with the role ARN in one step. Turn the two policy documents from the IAM step into managed policies it can attach:

435>

436> ```bash theme={null}

437> BEDROCK_POLICY_ARN="$(aws iam create-policy --policy-name claude-gateway-bedrock-invoke \

438> --policy-document file://bedrock-invoke.json --query Policy.Arn --output text)"

439> SECRETS_POLICY_ARN="$(aws iam create-policy --policy-name claude-gateway-secrets-read \

440> --policy-document file://secrets-read.json --query Policy.Arn --output text)"

441>

442> kubectl create namespace claude-gateway

443> eksctl create iamserviceaccount --cluster <your-cluster> --region "$AWS_REGION" \

444> --namespace claude-gateway --name gateway --role-name claude-gateway \

445> --attach-policy-arn "$BEDROCK_POLICY_ARN" \

446> --attach-policy-arn "$SECRETS_POLICY_ARN" \

447> --approve

448> ```

449>

450> The secrets policy is needed only when the pods read Secrets Manager themselves, as the Secrets Store CSI driver's AWS provider does using the mounting pod's service account; drop it if you create the Kubernetes Secrets another way. The provider needs both of the policy's actions: it calls `DescribeSecret` when it reconciles rotated secrets, so a `GetSecretValue`-only grant mounts on the first deploy but stops picking up rotations.

451>

452> Deploy the gateway as a standard Deployment plus a Service and an Ingress, as described in [Kubernetes deployment](https://code.claude.com/docs/en/claude-apps-gateway-deploy.md#kubernetes), with:

453>

454> * `serviceAccountName: gateway`

455> * `gateway.yaml` mounted from a ConfigMap and the secrets mounted at `/secrets`

456> * the readiness probe pointed at `GET /readyz`

457>

458> For the front end, an Ingress managed by the AWS Load Balancer Controller provisions the internal ALB. Annotate it with:

459>

460> * `alb.ingress.kubernetes.io/scheme: internal` and `alb.ingress.kubernetes.io/target-type: ip`

461> * `alb.ingress.kubernetes.io/ip-address-type: ipv4`, so no public-range AAAA records are published for the `/login` [private-network check](https://code.claude.com/docs/en/claude-apps-gateway#prerequisites) to reject

462> * `alb.ingress.kubernetes.io/inbound-cidrs: <your-corporate-cidr>`, so the controller-managed frontend security group admits only your corporate network in place of its `0.0.0.0/0` default

463> * `alb.ingress.kubernetes.io/certificate-arn` with the ACM certificate

464> * `alb.ingress.kubernetes.io/ssl-policy: ELBSecurityPolicy-TLS13-1-2-2021-06`, so the listener doesn't fall back to the legacy default policy that accepts TLS 1.0 and 1.1

465> * `alb.ingress.kubernetes.io/load-balancer-attributes: idle_timeout.timeout_seconds=3600`, a margin above the gateway's streaming keepalive; see [Troubleshooting](#troubleshooting)

466>

467> With IRSA, the AWS SDK reads a projected service-account token and exchanges it with AWS STS, so the pod never needs the EC2 instance metadata service; an egress NetworkPolicy may block `169.254.169.254` for gateway pods. The node hop-limit problem in [Troubleshooting](#troubleshooting) below applies only to clusters that skip IRSA and rely on node instance roles.

468 468 

469**8. Push the gateway URL to developer machines**469**8. Push the gateway URL to developer machines**

470 470 

Details

203 203 

204**7. Deploy**204**7. Deploy**

205 205 

206**Cloud Run**206> [tab] Cloud Run

207 

208The command below deploys for production behind an internal load balancer.

209 

210```bash theme={null}

211gcloud run deploy claude-gateway \

212 --image="${REGION}-docker.pkg.dev/${PROJECT_ID}/claude-gateway/gateway:<version>" \

213 --region="$REGION" \

214 --service-account="claude-gateway@${PROJECT_ID}.iam.gserviceaccount.com" \

215 --min-instances=1 \

216 --max-instances=8 \

217 --timeout=3600 \

218 --ingress=internal \

219 --network="$VPC" --subnet=cc-gateway-subnet --vpc-egress=private-ranges-only \

220 --set-secrets=/etc/claude/gateway.yaml=gateway-config:latest,GATEWAY_JWT_SECRET=gateway-jwt-secret:latest,OIDC_CLIENT_SECRET=gateway-oidc-client-secret:latest,GATEWAY_POSTGRES_URL=gateway-postgres-url:latest \

221 --no-invoker-iam-check

222```

223 

224Direct VPC egress, via `--network`, `--subnet`, and `--vpc-egress=private-ranges-only`, lets the service reach the Cloud SQL private IP directly. Public egress to Google Cloud's Agent Platform endpoints and `accounts.google.com` goes directly to the internet rather than through the VPC, so no Cloud NAT is needed.

225 

226> [!NOTE]

227>207>

228> Each instance holds up to [`store.max_connections`](https://code.claude.com/docs/en/claude-apps-gateway-config#store) Postgres connections, five by default. Use [Size the connection pool](https://code.claude.com/docs/en/claude-apps-gateway-deploy.md#size-the-connection-pool) to check `--max-instances=8` against the connections your database has left for the gateway, and include the extra instances a rolling update starts.208> The command below deploys for production behind an internal load balancer.

229 209>

230The invoker IAM check must be open or disabled. The gateway runs its own OIDC and its clients carry no GCP token, so Cloud Run's invoker check has to admit unauthenticated requests. The gateway's OIDC sign-in authenticates the request once it reaches the container, with `allowed_email_domains` gating which domains may sign in.210> ```bash theme={null}

231 211> gcloud run deploy claude-gateway \

232Two flags admit unauthenticated requests:212> --image="${REGION}-docker.pkg.dev/${PROJECT_ID}/claude-gateway/gateway:<version>" \

233 213> --region="$REGION" \

234* `--no-invoker-iam-check`: disables the check with no `allUsers` binding to manage, and works under Domain Restricted Sharing214> --service-account="claude-gateway@${PROJECT_ID}.iam.gserviceaccount.com" \

235* `--allow-unauthenticated`: grants `allUsers` the `run.invoker` role; use it if your organization doesn't allow `--no-invoker-iam-check`215> --min-instances=1 \

236 216> --max-instances=8 \

237Ingress restriction via `--ingress` is a separate, independent layer from the invoker check; keep it set to limit the service to your corporate network.217> --timeout=3600 \

238 218> --ingress=internal \

239By default the Cloud Run `*.run.app` URL resolves to a public address, which the `/login` [private-network check](https://code.claude.com/docs/en/claude-apps-gateway#prerequisites) rejects. Two topologies give developers a privately resolvable hostname, and Cloud Run provisions neither for you:219> --network="$VPC" --subnet=cc-gateway-subnet --vpc-egress=private-ranges-only \

240 220> --set-secrets=/etc/claude/gateway.yaml=gateway-config:latest,GATEWAY_JWT_SECRET=gateway-jwt-secret:latest,OIDC_CLIENT_SECRET=gateway-oidc-client-secret:latest,GATEWAY_POSTGRES_URL=gateway-postgres-url:latest \

241* **Internal Application Load Balancer**, the topology this page's `gateway.yaml` assumes: provision an internal Application Load Balancer in front of the service with an internal DNS name and certificate, and set `listen.public_url` to that hostname. The `internal` ingress setting already admits traffic from internal Application Load Balancers; `internal-and-cloud-load-balancing` additionally admits external Application Load Balancers, whose public addresses the `/login` private-network check rejects, so no topology on this page needs it.221> --no-invoker-iam-check

242* **Internal-only ingress with no load balancer**: keep the deploy command as is and leave `listen.public_url` as the `*.run.app` URL, the default in the [reference assets](#terraform-reference) below. For `*.run.app` to resolve privately, your network team must already operate a Private Service Connect endpoint for Google APIs, a Cloud DNS private zone resolving `*.run.app` to it, and on-premises routing to that endpoint.222> ```

243 223>

244Google's [private networking guide for Cloud Run](https://cloud.google.com/run/docs/securing/private-networking) covers the infrastructure both options need. Verify sign-in once the gateway is serving on a private hostname; until then, confirm the container booted from its logs in Cloud Run.224> Direct VPC egress, via `--network`, `--subnet`, and `--vpc-egress=private-ranges-only`, lets the service reach the Cloud SQL private IP directly. Public egress to Google Cloud's Agent Platform endpoints and `accounts.google.com` goes directly to the internet rather than through the VPC, so no Cloud NAT is needed.

245 225>

246Update the OAuth client's authorized redirect URI to `<public_url>/oauth/callback` before the first sign-in. Redeploy after changing `public_url`, because the gateway builds its public origin only from that setting and ignores `X-Forwarded-Host` and `X-Forwarded-Proto`. `X-Forwarded-For` is honored for client IPs only when `listen.trusted_proxies` is set.226> > [!NOTE]

247 227> >

248**GKE**228> > Each instance holds up to [`store.max_connections`](https://code.claude.com/docs/en/claude-apps-gateway-config#store) Postgres connections, five by default. Use [Size the connection pool](https://code.claude.com/docs/en/claude-apps-gateway-deploy.md#size-the-connection-pool) to check `--max-instances=8` against the connections your database has left for the gateway, and include the extra instances a rolling update starts.

249 229>

250The cluster must be on the `$VPC` created in the Cloud SQL step so pods can reach the database's private IP; VPC peering alone doesn't work, because Cloud SQL private IP is itself a peered network and peering is non-transitive. To create a new cluster on that VPC, pass `--network="$VPC" --subnetwork=cc-gateway-subnet` to `gcloud container clusters create`.230> The invoker IAM check must be open or disabled. The gateway runs its own OIDC and its clients carry no GCP token, so Cloud Run's invoker check has to admit unauthenticated requests. The gateway's OIDC sign-in authenticates the request once it reaches the container, with `allowed_email_domains` gating which domains may sign in.

251 231>

252Enable Workload Identity on the cluster and its node pools, then bind the Google service account to the Kubernetes service account so pods inherit its credentials:232> Two flags admit unauthenticated requests:

253 233>

254```bash theme={null}234> * `--no-invoker-iam-check`: disables the check with no `allUsers` binding to manage, and works under Domain Restricted Sharing

255gcloud container clusters update <cluster> --region="$REGION" \235> * `--allow-unauthenticated`: grants `allUsers` the `run.invoker` role; use it if your organization doesn't allow `--no-invoker-iam-check`

256 --workload-pool="${PROJECT_ID}.svc.id.goog"236>

257# On a Standard cluster, existing node pools also need GKE_METADATA;237> Ingress restriction via `--ingress` is a separate, independent layer from the invoker check; keep it set to limit the service to your corporate network.

258# Autopilot enables this by default.238>

259gcloud container node-pools update <pool> --cluster=<cluster> \239> By default the Cloud Run `*.run.app` URL resolves to a public address, which the `/login` [private-network check](https://code.claude.com/docs/en/claude-apps-gateway#prerequisites) rejects. Two topologies give developers a privately resolvable hostname, and Cloud Run provisions neither for you:

260 --region="$REGION" --workload-metadata=GKE_METADATA240>

261 241> * **Internal Application Load Balancer**, the topology this page's `gateway.yaml` assumes: provision an internal Application Load Balancer in front of the service with an internal DNS name and certificate, and set `listen.public_url` to that hostname. The `internal` ingress setting already admits traffic from internal Application Load Balancers; `internal-and-cloud-load-balancing` additionally admits external Application Load Balancers, whose public addresses the `/login` private-network check rejects, so no topology on this page needs it.

262kubectl create namespace claude-gateway242> * **Internal-only ingress with no load balancer**: keep the deploy command as is and leave `listen.public_url` as the `*.run.app` URL, the default in the [reference assets](#terraform-reference) below. For `*.run.app` to resolve privately, your network team must already operate a Private Service Connect endpoint for Google APIs, a Cloud DNS private zone resolving `*.run.app` to it, and on-premises routing to that endpoint.

263kubectl create serviceaccount gateway -n claude-gateway243>

264 244> Google's [private networking guide for Cloud Run](https://cloud.google.com/run/docs/securing/private-networking) covers the infrastructure both options need. Verify sign-in once the gateway is serving on a private hostname; until then, confirm the container booted from its logs in Cloud Run.

265gcloud iam service-accounts add-iam-policy-binding \245>

266 "claude-gateway@${PROJECT_ID}.iam.gserviceaccount.com" \246> Update the OAuth client's authorized redirect URI to `<public_url>/oauth/callback` before the first sign-in. Redeploy after changing `public_url`, because the gateway builds its public origin only from that setting and ignores `X-Forwarded-Host` and `X-Forwarded-Proto`. `X-Forwarded-For` is honored for client IPs only when `listen.trusted_proxies` is set.

267 --role roles/iam.workloadIdentityUser \

268 --member "serviceAccount:${PROJECT_ID}.svc.id.goog[claude-gateway/gateway]"

269 

270kubectl annotate serviceaccount gateway -n claude-gateway \

271 iam.gke.io/gcp-service-account="claude-gateway@${PROJECT_ID}.iam.gserviceaccount.com"

272```

273 

274Deploy the gateway as a standard Deployment plus a Service and an internal Ingress, class `gce-internal`, as described in [Kubernetes deployment](https://code.claude.com/docs/en/claude-apps-gateway-deploy.md#kubernetes), with:

275 

276* `serviceAccountName: gateway`

277* the Secret Manager CSI driver mounting secrets at `/secrets`

278* the readiness probe pointed at `GET /readyz`

279 

280Attach a BackendConfig with a raised `timeoutSec` to the gateway Service: the load balancer backend service behind GKE Ingress defaults to a 30-second timeout, which cuts off long streaming responses.

281 

282Don't apply an egress NetworkPolicy that blocks `169.254.169.254` on a Workload Identity cluster; the pod must reach the metadata server for credentials. The gateway's built-in [SSRF guard](https://code.claude.com/docs/en/claude-apps-gateway-deploy.md#threat-model-summary) is the defense there.

283 247 

284The gateway logs a boot warning that the metadata endpoint is reachable and suggests applying an egress NetworkPolicy. Under Workload Identity that warning is expected, because the pod needs the endpoint.248> [tab] GKE

249>

250> The cluster must be on the `$VPC` created in the Cloud SQL step so pods can reach the database's private IP; VPC peering alone doesn't work, because Cloud SQL private IP is itself a peered network and peering is non-transitive. To create a new cluster on that VPC, pass `--network="$VPC" --subnetwork=cc-gateway-subnet` to `gcloud container clusters create`.

251>

252> Enable Workload Identity on the cluster and its node pools, then bind the Google service account to the Kubernetes service account so pods inherit its credentials:

253>

254> ```bash theme={null}

255> gcloud container clusters update <cluster> --region="$REGION" \

256> --workload-pool="${PROJECT_ID}.svc.id.goog"

257> # On a Standard cluster, existing node pools also need GKE_METADATA;

258> # Autopilot enables this by default.

259> gcloud container node-pools update <pool> --cluster=<cluster> \

260> --region="$REGION" --workload-metadata=GKE_METADATA

261>

262> kubectl create namespace claude-gateway

263> kubectl create serviceaccount gateway -n claude-gateway

264>

265> gcloud iam service-accounts add-iam-policy-binding \

266> "claude-gateway@${PROJECT_ID}.iam.gserviceaccount.com" \

267> --role roles/iam.workloadIdentityUser \

268> --member "serviceAccount:${PROJECT_ID}.svc.id.goog[claude-gateway/gateway]"

269>

270> kubectl annotate serviceaccount gateway -n claude-gateway \

271> iam.gke.io/gcp-service-account="claude-gateway@${PROJECT_ID}.iam.gserviceaccount.com"

272> ```

273>

274> Deploy the gateway as a standard Deployment plus a Service and an internal Ingress, class `gce-internal`, as described in [Kubernetes deployment](https://code.claude.com/docs/en/claude-apps-gateway-deploy.md#kubernetes), with:

275>

276> * `serviceAccountName: gateway`

277> * the Secret Manager CSI driver mounting secrets at `/secrets`

278> * the readiness probe pointed at `GET /readyz`

279>

280> Attach a BackendConfig with a raised `timeoutSec` to the gateway Service: the load balancer backend service behind GKE Ingress defaults to a 30-second timeout, which cuts off long streaming responses.

281>

282> Don't apply an egress NetworkPolicy that blocks `169.254.169.254` on a Workload Identity cluster; the pod must reach the metadata server for credentials. The gateway's built-in [SSRF guard](https://code.claude.com/docs/en/claude-apps-gateway-deploy.md#threat-model-summary) is the defense there.

283>

284> The gateway logs a boot warning that the metadata endpoint is reachable and suggests applying an egress NetworkPolicy. Under Workload Identity that warning is expected, because the pod needs the endpoint.

285 285 

286**8. Push the gateway URL to developer machines**286**8. Push the gateway URL to developer machines**

287 287 

Details

8 8 

9> [!NOTE]9> [!NOTE]

10>10>

11> Cloud sessions are available on Pro, Max, and Team plans, and for Enterprise users with premium seats or Chat + Claude Code seats. If [custom roles](https://support.claude.com/en/articles/13930452) govern your access, you also need a role with the cloud sessions permission to start sessions on Anthropic's infrastructure from the browser, apps, or terminal. Ask an Owner to add it to one of your roles at [**Organization settings > Roles**](https://claude.ai/admin-settings/roles).11> Cloud sessions are available on Pro, Max, Ultra, and Team plans, and for Enterprise users with premium seats or Chat + Claude Code seats. If [custom roles](https://support.claude.com/en/articles/13930452) govern your access, you also need a role with the cloud sessions permission to start sessions on Anthropic's infrastructure from the browser, apps, or terminal. Ask an Owner to add it to one of your roles at [**Organization settings > Roles**](https://claude.ai/admin-settings/roles).

12 12 

13A cloud session is a Claude Code session that runs on cloud infrastructure instead of on your machine. By default it runs on infrastructure Anthropic manages, or on your organization's [self-hosted environment](https://code.claude.com/docs/en/self-hosted-environments) when routed there. The session keeps running after you close your laptop, and you can check on it or steer it from any device. It counts toward your plan's usage limits alongside the rest of your Claude and Claude Code usage, and there's no separate charge for the cloud VM.13A cloud session is a Claude Code session that runs on cloud infrastructure instead of on your machine. By default it runs on infrastructure Anthropic manages, or on your organization's [self-hosted environment](https://code.claude.com/docs/en/self-hosted-environments) when routed there. The session keeps running after you close your laptop, and you can check on it or steer it from any device. It counts toward your plan's usage limits alongside the rest of your Claude and Claude Code usage, and there's no separate charge for the cloud VM.

14 14 


342* **Your name**: your account's display name is visible to all recipients with access342* **Your name**: your account's display name is visible to all recipients with access

343* **Slack sessions**: [Claude in Slack](https://code.claude.com/docs/en/slack.md) sessions are automatically shared with Team visibility343* **Slack sessions**: [Claude in Slack](https://code.claude.com/docs/en/slack.md) sessions are automatically shared with Team visibility

344 344 

345#### Share from a Max or Pro account345#### Share from a Max, Ultra, or Pro account

346 

347Sharing works as follows for Max and Pro accounts:

348 346 

349* **Visibility options**: **Private** and **Public**. Public visibility makes the session visible to any user logged into claude.ai347* **Visibility options**: **Private** and **Public**. Public visibility makes the session visible to any user logged into claude.ai

350* **Repository access**: verification isn't enabled by default348* **Repository access**: verification isn't enabled by default

Details

8 8 

9> [!NOTE]9> [!NOTE]

10>10>

11> Projects are in public beta on Pro and Max plans and rolling out gradually. The rollout started with accounts that have used [cloud sessions](https://code.claude.com/docs/en/claude-code-on-the-web.md) and don't have existing projects in claude.ai chat or Cowork. Projects aren't offered on Team or Enterprise plans yet.11> Projects are in public beta on Pro, Max, and Ultra plans and rolling out gradually. The rollout started with accounts that have used [cloud sessions](https://code.claude.com/docs/en/claude-code-on-the-web.md) and don't have existing projects in claude.ai chat or Cowork. Projects aren't offered on Team or Enterprise plans yet.

12>12>

13> If you don't see **Projects** in the sidebar at [claude.ai/code](https://claude.ai/code) or in the Code tab of the [desktop app](https://code.claude.com/docs/en/desktop.md), check under **More** there. If it's missing there too, the rollout hasn't reached your account yet. You can [join the waitlist](https://claude.com/form/projects), and see [Run agents in parallel](https://code.claude.com/docs/en/agents.md) for what you can use in the meantime.13> If you don't see **Projects** in the sidebar at [claude.ai/code](https://claude.ai/code) or in the Code tab of the [desktop app](https://code.claude.com/docs/en/desktop.md), check under **More** there. If it's missing there too, the rollout hasn't reached your account yet. You can [join the waitlist](https://claude.com/form/projects), and see [Run agents in parallel](https://code.claude.com/docs/en/agents.md) for what you can use in the meantime.

14 14 


78 78 

79Before you create a project, check your plan, your GitHub setup, and what the work needs to reach:79Before you create a project, check your plan, your GitHub setup, and what the work needs to reach:

80 80 

81* **Plan**: you're on Pro or Max, and **Projects** shows in your sidebar, directly or under **More**. Select **Projects** and check that it offers **New project** or **Get started**.81* **Plan**: you're on Pro, Max, or Ultra, and **Projects** shows in your sidebar, directly or under **More**. Select **Projects** and check that it offers **New project** or **Get started**.

82* **GitHub, if the project will work on code**: your code is on github.com rather than GitHub Enterprise Server, GitLab, or Bitbucket, your connected GitHub account has push access to it, and the Claude GitHub App is installed on it. If you connected GitHub with [`/web-setup`](https://code.claude.com/docs/en/web-quickstart#connect-from-your-terminal), that token lets your other cloud sessions reach a repository but isn't enough for a project's cloud threads, which need the Claude GitHub App. [Set up GitHub access](#set-up-github-access) has the steps.82* **GitHub, if the project will work on code**: your code is on github.com rather than GitHub Enterprise Server, GitLab, or Bitbucket, your connected GitHub account has push access to it, and the Claude GitHub App is installed on it. If you connected GitHub with [`/web-setup`](https://code.claude.com/docs/en/web-quickstart#connect-from-your-terminal), that token lets your other cloud sessions reach a repository but isn't enough for a project's cloud threads, which need the Claude GitHub App. [Set up GitHub access](#set-up-github-access) has the steps.

83* **Network access, secrets, and tools**: for cloud threads, these come from the project's [cloud environment](#choose-an-environment-for-threads). The default environment already reaches [common package registries](https://code.claude.com/docs/en/cloud-environments.md#default-allowed-domains), so check this only if the work needs other domains, a secret, or a tool that isn't preinstalled. If the work needs an MCP server, check that it shows as connected in your [claude.ai connectors](https://claude.ai/customize/connectors).83* **Network access, secrets, and tools**: for cloud threads, these come from the project's [cloud environment](#choose-an-environment-for-threads). The default environment already reaches [common package registries](https://code.claude.com/docs/en/cloud-environments.md#default-allowed-domains), so check this only if the work needs other domains, a secret, or a tool that isn't preinstalled. If the work needs an MCP server, check that it shows as connected in your [claude.ai connectors](https://claude.ai/customize/connectors).

84 84 


421 421 

422Open **Usage** in **Project settings** to see token use by thread and by model, and how much went to the project conversation. To bring it down:422Open **Usage** in **Project settings** to see token use by thread and by model, and how much went to the project conversation. To bring it down:

423 423 

424* A follow-up routed to a thread that has been idle longer than the [cache lifetime](https://code.claude.com/docs/en/prompt-caching.md#cache-lifetime), an hour on Pro and Max within your plan's limits, re-reads that thread's whole conversation before doing anything. For new work, asking Claude to start a fresh thread can use less than reviving a large old one.424* On Pro, Max, and Ultra within your plan's limits, the [cache lifetime](https://code.claude.com/docs/en/prompt-caching.md#cache-lifetime) is an hour. A thread that has been idle longer than that re-reads its whole conversation before doing anything when a follow-up reaches it. For new work, ask Claude to start a fresh thread, which can use less than reviving a large old one.

425* For work that doesn't need the largest model, [choose a smaller model or a lower effort level](#choose-models-and-let-claude-manage-context) for threads, the conversation, or both.425* For work that doesn't need the largest model, [choose a smaller model or a lower effort level](#choose-models-and-let-claude-manage-context) for threads, the conversation, or both.

426* Ask Claude in the project conversation to run fewer threads at a time, or to answer small questions itself instead of starting a thread.426* Ask Claude in the project conversation to run fewer threads at a time, or to answer small questions itself instead of starting a thread.

427 427 


429 429 

430Several Claude Code features let more than one session work at the same time, so running work in parallel is not by itself what a project is for. In a project, Claude starts and tracks the sessions instead of you, and each one starts from the same instructions. This is how each neighboring feature connects to a project:430Several Claude Code features let more than one session work at the same time, so running work in parallel is not by itself what a project is for. In a project, Claude starts and tracks the sessions instead of you, and each one starts from the same instructions. This is how each neighboring feature connects to a project:

431 431 

432* **Claude Tag**: [Claude Tag](https://claude.com/docs/claude-tag/overview) is Claude in your team's Slack channels, on Team and Enterprise plans. Anyone in a channel can give it work, everyone in the channel sees and steers it, and it uses connections an admin set up for that channel. A project is yours alone: you're the only one who sends it work or sees its threads, it uses your own GitHub access and connectors, and it's on Pro and Max. [How Claude Tag differs from Cowork and Claude Code](https://claude.com/docs/claude-tag/concepts/how-it-works#how-claude-tag-differs-from-cowork-and-claude-code) has the side-by-side.432* **Claude Tag**: [Claude Tag](https://claude.com/docs/claude-tag/overview) is Claude in your team's Slack channels, on Team and Enterprise plans. Anyone in a channel can give it work, everyone in the channel sees and steers it, and it uses connections an admin set up for that channel.

433 

434 Projects are on Pro, Max, and Ultra. A project is yours alone: you're the only one who sends it work or sees its threads, and it uses your own GitHub access and connectors. [How Claude Tag differs from Cowork and Claude Code](https://claude.com/docs/claude-tag/concepts/how-it-works#how-claude-tag-differs-from-cowork-and-claude-code) has the side-by-side.

433* **Cloud sessions**: every thread is a [cloud session](https://code.claude.com/docs/en/claude-code-on-the-web.md) unless you ask Claude to run it on your machine. Either way, Claude starts and tracks it instead of you. You can also bring the work of a cloud session you started yourself into a project: choose [**Continue in project**](#start-from-an-existing-cloud-session) in that session's sidebar menu.435* **Cloud sessions**: every thread is a [cloud session](https://code.claude.com/docs/en/claude-code-on-the-web.md) unless you ask Claude to run it on your machine. Either way, Claude starts and tracks it instead of you. You can also bring the work of a cloud session you started yourself into a project: choose [**Continue in project**](#start-from-an-existing-cloud-session) in that session's sidebar menu.

434* **Scheduled tasks**: when you ask for scheduled work in a project, Claude creates a [cloud scheduled task](https://code.claude.com/docs/en/routines.md) that runs as threads in that project and appears on its **Scheduled tasks** tab. Scheduled tasks you create outside a project keep working on their own.436* **Scheduled tasks**: when you ask for scheduled work in a project, Claude creates a [cloud scheduled task](https://code.claude.com/docs/en/routines.md) that runs as threads in that project and appears on its **Scheduled tasks** tab. Scheduled tasks you create outside a project keep working on their own.

435* **Remote Control**: [Remote Control](https://code.claude.com/docs/en/remote-control.md) connects claude.ai to a Claude Code session running on your machine. When you ask Claude in a project to run a thread on your computer, the project [uses Remote Control to do it](#run-a-thread-on-your-own-computer).437* **Remote Control**: [Remote Control](https://code.claude.com/docs/en/remote-control.md) connects claude.ai to a Claude Code session running on your machine. When you ask Claude in a project to run a thread on your computer, the project [uses Remote Control to do it](#run-a-thread-on-your-own-computer).

Details

8 8 

9> [!NOTE]9> [!NOTE]

10>10>

11> Cloud environments apply to [cloud sessions](https://code.claude.com/docs/en/claude-code-on-the-web.md), which are available on Pro, Max, and Team plans, and for Enterprise users with [premium seats or Chat + Claude Code seats](https://support.claude.com/en/articles/11845131-use-claude-code-with-your-team-or-enterprise-plan).11> Cloud environments apply to [cloud sessions](https://code.claude.com/docs/en/claude-code-on-the-web.md), which are available on Pro, Max, Ultra, and Team plans, and for Enterprise users with [premium seats or Chat + Claude Code seats](https://support.claude.com/en/articles/11845131-use-claude-code-with-your-team-or-enterprise-plan).

12 12 

13Each [cloud session](https://code.claude.com/docs/en/claude-code-on-the-web.md) runs in a cloud environment. You can configure an environment to allow or deny [network access](#access-levels), [set environment variables](#set-environment-variables) for the session, store [network secrets](#add-network-secrets) that sessions use without seeing them, and run a [setup script](#setup-scripts) before Claude starts working.13Each [cloud session](https://code.claude.com/docs/en/claude-code-on-the-web.md) runs in a cloud environment. You can configure an environment to allow or deny [network access](#access-levels), [set environment variables](#set-environment-variables) for the session, store [network secrets](#add-network-secrets) that sessions use without seeing them, and run a [setup script](#setup-scripts) before Claude starts working.

14 14 


32If you don't have an environment yet, onboarding sets up the **Default** environment. How depends on where you onboard:32If you don't have an environment yet, onboarding sets up the **Default** environment. How depends on where you onboard:

33 33 

34* **CLI flows such as `/web-setup`**: create **Default** for you34* **CLI flows such as `/web-setup`**: create **Default** for you

35* **Web onboarding on Pro and Max**: creates **Default** for you35* **Web onboarding on Pro, Max, and Ultra**: you get **Default** automatically

36* **Web onboarding on Team and Enterprise**: shows a **Create your first cloud environment** form unless an Owner has turned on [Quick setup](https://code.claude.com/docs/en/claude-code-on-the-web.md#quick-setup-for-team-and-enterprise); keep the form's defaults and click **Create & finish** to get the same **Default** environment36* **Web onboarding on Team and Enterprise**: shows a **Create your first cloud environment** form unless an Owner has turned on [Quick setup](https://code.claude.com/docs/en/claude-code-on-the-web.md#quick-setup-for-team-and-enterprise); keep the form's defaults and click **Create & finish** to get the same **Default** environment

37 37 

38**Default** carries no configuration of its own:38**Default** carries no configuration of its own:


93 93 

94A network secret is an API key or token you store on a cloud environment so Claude can call that API from any session in the environment without seeing the key. Anthropic's agent proxy adds the key to requests for the hosts you list, after each request leaves the session's VM, so the key itself stays outside the VM.94A network secret is an API key or token you store on a cloud environment so Claude can call that API from any session in the environment without seeing the key. Anthropic's agent proxy adds the key to requests for the hosts you list, after each request leaves the session's VM, so the key itself stays outside the VM.

95 95 

96Network secrets are available on Pro, Max, Team, and Enterprise plans. To check whether you can add one yourself, see [Requirements](#requirements).96Network secrets are available on Pro, Max, Ultra, Team, and Enterprise plans. To check whether you can add one yourself, see [Requirements](#requirements).

97 97 

98#### Requirements98#### Requirements

99 99 


552 552 

553With **Trusted** network access, sessions can reach the following domains by default. Domains marked with `*` indicate wildcard subdomain matching, so `*.gcr.io` allows any subdomain of `gcr.io`.553With **Trusted** network access, sessions can reach the following domains by default. Domains marked with `*` indicate wildcard subdomain matching, so `*.gcr.io` allows any subdomain of `gcr.io`.

554 554 

555> **Anthropic services**555> [accordion] Anthropic services

556>556>

557> * api.anthropic.com557> * api.anthropic.com

558> * docs.claude.com558> * docs.claude.com


564> * anthropic.com564> * anthropic.com

565> * [www.anthropic.com](http://www.anthropic.com)565> * [www.anthropic.com](http://www.anthropic.com)

566 566 

567> **Version control**567> [accordion] Version control

568>568>

569> * github.com569> * github.com

570> * [www.github.com](http://www.github.com)570> * [www.github.com](http://www.github.com)


585> * [www.bitbucket.org](http://www.bitbucket.org)585> * [www.bitbucket.org](http://www.bitbucket.org)

586> * api.bitbucket.org586> * api.bitbucket.org

587 587 

588> **Container registries**588> [accordion] Container registries

589>589>

590> * registry-1.docker.io590> * registry-1.docker.io

591> * auth.docker.io591> * auth.docker.io


602> * \*.data.mcr.microsoft.com602> * \*.data.mcr.microsoft.com

603> * public.ecr.aws603> * public.ecr.aws

604 604 

605> **Cloud platforms**605> [accordion] Cloud platforms

606>606>

607> * cloud.google.com607> * cloud.google.com

608> * accounts.google.com608> * accounts.google.com


633> * yum.oracle.com633> * yum.oracle.com

634> * \*.r2.cloudflarestorage.com634> * \*.r2.cloudflarestorage.com

635 635 

636> **JavaScript and Node package managers**636> [accordion] JavaScript and Node package managers

637>637>

638> * registry.npmjs.org638> * registry.npmjs.org

639> * [www.npmjs.com](http://www.npmjs.com)639> * [www.npmjs.com](http://www.npmjs.com)


645> * jsr.io645> * jsr.io

646> * npm.jsr.io646> * npm.jsr.io

647 647 

648> **Python package managers**648> [accordion] Python package managers

649>649>

650> * pypi.org650> * pypi.org

651> * [www.pypi.org](http://www.pypi.org)651> * [www.pypi.org](http://www.pypi.org)


656> * pypa.io656> * pypa.io

657> * [www.pypa.io](http://www.pypa.io)657> * [www.pypa.io](http://www.pypa.io)

658 658 

659> **Ruby package managers**659> [accordion] Ruby package managers

660>660>

661> * rubygems.org661> * rubygems.org

662> * [www.rubygems.org](http://www.rubygems.org)662> * [www.rubygems.org](http://www.rubygems.org)


671> * rvm.io671> * rvm.io

672> * get.rvm.io672> * get.rvm.io

673 673 

674> **Rust package managers**674> [accordion] Rust package managers

675>675>

676> * crates.io676> * crates.io

677> * [www.crates.io](http://www.crates.io)677> * [www.crates.io](http://www.crates.io)


681> * static.rust-lang.org681> * static.rust-lang.org

682> * [www.rust-lang.org](http://www.rust-lang.org)682> * [www.rust-lang.org](http://www.rust-lang.org)

683 683 

684> **Go package managers**684> [accordion] Go package managers

685>685>

686> * proxy.golang.org686> * proxy.golang.org

687> * sum.golang.org687> * sum.golang.org


691> * goproxy.io691> * goproxy.io

692> * pkg.go.dev692> * pkg.go.dev

693 693 

694> **JVM package managers**694> [accordion] JVM package managers

695>695>

696> * maven.org696> * maven.org

697> * repo.maven.org697> * repo.maven.org


710> * spring.io710> * spring.io

711> * repo.spring.io711> * repo.spring.io

712 712 

713> **Other package managers**713> [accordion] Other package managers

714>714>

715> * packagist.org (PHP Composer)715> * packagist.org (PHP Composer)

716> * [www.packagist.org](http://www.packagist.org)716> * [www.packagist.org](http://www.packagist.org)


736> * swift.org736> * swift.org

737> * [www.swift.org](http://www.swift.org)737> * [www.swift.org](http://www.swift.org)

738 738 

739> **Linux distributions**739> [accordion] Linux distributions

740>740>

741> * archive.ubuntu.com741> * archive.ubuntu.com

742> * security.ubuntu.com742> * security.ubuntu.com


748> * [www.launchpad.net](http://www.launchpad.net)748> * [www.launchpad.net](http://www.launchpad.net)

749> * \*.nixos.org749> * \*.nixos.org

750 750 

751> **Development tools and platforms**751> [accordion] Development tools and platforms

752>752>

753> * dl.k8s.io (Kubernetes)753> * dl.k8s.io (Kubernetes)

754> * pkgs.k8s.io754> * pkgs.k8s.io


780> * pkg.stainless.com780> * pkg.stainless.com

781> * binaries.prisma.sh781> * binaries.prisma.sh

782 782 

783> **Cloud services and monitoring**783> [accordion] Cloud services and monitoring

784>784>

785> * http-intake.logs.datadoghq.com785> * http-intake.logs.datadoghq.com

786> * \*.datadoghq.com786> * \*.datadoghq.com

787> * \*.datadoghq.eu787> * \*.datadoghq.eu

788> * api.honeycomb.io788> * api.honeycomb.io

789 789 

790> **Content delivery and mirrors**790> [accordion] Content delivery and mirrors

791>791>

792> * sourceforge.net792> * sourceforge.net

793> * \*.sourceforge.net793> * \*.sourceforge.net


796> * fonts.googleapis.com796> * fonts.googleapis.com

797> * fonts.gstatic.com797> * fonts.gstatic.com

798 798 

799> **Schema and configuration**799> [accordion] Schema and configuration

800>800>

801> * json-schema.org801> * json-schema.org

802> * [www.json-schema.org](http://www.json-schema.org)802> * [www.json-schema.org](http://www.json-schema.org)

803> * json.schemastore.org803> * json.schemastore.org

804> * [www.schemastore.org](http://www.schemastore.org)804> * [www.schemastore.org](http://www.schemastore.org)

805 805 

806> **Model Context Protocol**806> [accordion] Model Context Protocol

807>807>

808> * \*.modelcontextprotocol.io808> * \*.modelcontextprotocol.io

809 809 

code-review.md +5 −5

Details

32 32 

33Pick the page for what you need to do:33Pick the page for what you need to do:

34 34 

35> **[Set up Code Review](https://code.claude.com/docs/en/code-review-setup.md)**35> [card] [Set up Code Review](https://code.claude.com/docs/en/code-review-setup.md)

36>36>

37> Check the requirements, install the Claude GitHub App, and choose repositories, a review level, and when reviews run37> Check the requirements, install the Claude GitHub App, and choose repositories, a review level, and when reviews run

38 38 

39> **[Customize Code Review](https://code.claude.com/docs/en/code-review-customize.md)**39> [card] [Customize Code Review](https://code.claude.com/docs/en/code-review-customize.md)

40>40>

41> Tune what gets flagged with `REVIEW.md` and `CLAUDE.md` files in your repository41> Tune what gets flagged with `REVIEW.md` and `CLAUDE.md` files in your repository

42 42 

43> **[Read and request reviews on a pull request](https://code.claude.com/docs/en/code-review-pull-requests.md)**43> [card] [Read and request reviews on a pull request](https://code.claude.com/docs/en/code-review-pull-requests.md)

44>44>

45> Read the findings and their severities, and request another review with a comment45> Read the findings and their severities, and request another review with a comment

46 46 

47> **[Troubleshoot Code Review](https://code.claude.com/docs/en/code-review-troubleshooting.md)**47> [card] [Troubleshoot Code Review](https://code.claude.com/docs/en/code-review-troubleshooting.md)

48>48>

49> Fix a review that didn't start, failed, or was skipped for budget49> Fix a review that didn't start, failed, or was skipped for budget

50 50 

51> **[Code Review costs and usage](https://code.claude.com/docs/en/code-review-costs.md)**51> [card] [Code Review costs and usage](https://code.claude.com/docs/en/code-review-costs.md)

52>52>

53> See how reviews are billed, estimate spend, set the monthly spend limit, and track review activity53> See how reviews are billed, estimate spend, set the monthly spend limit, and track review activity

54 54 

commands.md +5 −5

Details

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

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

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

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

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

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

61| `/background [prompt]` | Detach the current session to run as a [background agent](https://code.claude.com/docs/en/agent-view.md) and free this terminal. Pass a prompt to send one more instruction before detaching. Monitor the session with `claude agents`. To copy the conversation into a new background session while this one keeps running, use `/fork`. Alias: `/bg` |61| `/background [prompt]` | Detach the current session to run as a [background agent](https://code.claude.com/docs/en/agent-view.md) and free this terminal. Pass a prompt to send one more instruction before detaching. Monitor the session with `claude agents`. To copy the conversation into a new background session while this one keeps running, use `/fork`. Alias: `/bg` |


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

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

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

123| `/privacy-settings` | View and update your privacy settings. Only available for Pro and Max plan subscribers |123| `/privacy-settings` | View and update your privacy settings. Only available for Pro, Max, and Ultra plan subscribers |

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

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

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


130| `/remote-control` | Make this session available for [Remote Control](https://code.claude.com/docs/en/remote-control.md) from claude.ai. Running it while signed out prints that Remote Control requires a claude.ai subscription and tells you how to sign in. Alias: `/rc` |130| `/remote-control` | Make this session available for [Remote Control](https://code.claude.com/docs/en/remote-control.md) from claude.ai. Running it while signed out prints that Remote Control requires a claude.ai subscription and tells you how to sign in. Alias: `/rc` |

131| `/remote-env` | Choose the default [cloud environment](https://code.claude.com/docs/en/cloud-environments.md#select-an-environment-from-the-cli) for cloud sessions you start from the CLI |131| `/remote-env` | Choose the default [cloud environment](https://code.claude.com/docs/en/cloud-environments.md#select-an-environment-from-the-cli) for cloud sessions you start from the CLI |

132| `/rename [name]` | Rename the current session and show the name on the prompt bar. Without a name, auto-generates one from conversation history. Also available in non-interactive mode (`-p`). From every rename surface, including claude.ai and the desktop app, Claude Code replaces control and invisible characters in the new name with spaces and caps the name at 200 characters. If the name is empty once invisible characters are removed, Claude Code rejects it and shows `That name is empty once invisible characters are removed. Usage: /rename <name>`. The character replacement and length cap require Claude Code v2.1.221 or later |132| `/rename [name]` | Rename the current session and show the name on the prompt bar. Without a name, auto-generates one from conversation history. Also available in non-interactive mode (`-p`). From every rename surface, including claude.ai and the desktop app, Claude Code replaces control and invisible characters in the new name with spaces and caps the name at 200 characters. If the name is empty once invisible characters are removed, Claude Code rejects it and shows `That name is empty once invisible characters are removed. Usage: /rename <name>`. The character replacement and length cap require Claude Code v2.1.221 or later |

133| `/restart` | Restart Claude Code and resume this session, which applies an installed update. Run it when the footer offers it after an update installs. Requires a Pro or Max plan and a native install on macOS or Linux, not WSL. Requires Claude Code v2.1.288 or later. Alias: `/update` |133| `/restart` | Restart Claude Code and resume this session, which applies an installed update. Run it when the footer offers it after an update installs. Requires a Pro, Max, or Ultra plan and a native install on macOS or Linux, not WSL. Requires Claude Code v2.1.288 or later. Alias: `/update` |

134| `/resume [session]` | Resume a conversation by ID or name, or open the session picker. [Background sessions](https://code.claude.com/docs/en/agent-view.md) appear in the picker marked with `bg`. Resuming one that is still running, from the picker or by ID or name, [opens that session](https://code.claude.com/docs/en/sessions.md#resume-a-running-background-session): your current conversation moves to the background and this terminal attaches to the running one. Press `←` on an empty prompt to return to agent view, which also lists the conversation you left. Before v2.1.285, Claude Code refused and told you to open the session with `claude attach` or stop it first. Alias: `/continue` |134| `/resume [session]` | Resume a conversation by ID or name, or open the session picker. [Background sessions](https://code.claude.com/docs/en/agent-view.md) appear in the picker marked with `bg`. Resuming one that is still running, from the picker or by ID or name, [opens that session](https://code.claude.com/docs/en/sessions.md#resume-a-running-background-session): your current conversation moves to the background and this terminal attaches to the running one. Press `←` on an empty prompt to return to agent view, which also lists the conversation you left. Before v2.1.285, Claude Code refused and told you to open the session with `claude attach` or stop it first. Alias: `/continue` |

135| `/review [low\|medium\|high\|xhigh\|max\|ultra] [--fix] [--comment] [--max-findings n\|all\|default] [pr#\|branch\|path]` | Alias of [`/code-review`](https://code.claude.com/docs/en/code-review-local): reviews the current diff, or a PR number, branch, or path you pass, such as `/review 1234`, and takes the same effort levels and flags. With no level given, the review reuses the last `low` through `max` level you typed; see [Review locally with `/code-review`](https://code.claude.com/docs/en/code-review-local) for the exact rules. For a deep cloud review, use [`/code-review ultra`](https://code.claude.com/docs/en/ultrareview). Before v2.1.223, `/review` was a separate command that ran a single-pass, read-only review of a GitHub pull request by number, listing open PRs to pick from when run with no argument; from v2.1.186 through v2.1.201, it ran the same multi-agent engine as `/code-review medium` |135| `/review [low\|medium\|high\|xhigh\|max\|ultra] [--fix] [--comment] [--max-findings n\|all\|default] [pr#\|branch\|path]` | Alias of [`/code-review`](https://code.claude.com/docs/en/code-review-local): reviews the current diff, or a PR number, branch, or path you pass, such as `/review 1234`, and takes the same effort levels and flags. With no level given, the review reuses the last `low` through `max` level you typed; see [Review locally with `/code-review`](https://code.claude.com/docs/en/code-review-local) for the exact rules. For a deep cloud review, use [`/code-review ultra`](https://code.claude.com/docs/en/ultrareview). Before v2.1.223, `/review` was a separate command that ran a single-pass, read-only review of a GitHub pull request by number, listing open PRs to pick from when run with no argument; from v2.1.186 through v2.1.201, it ran the same multi-agent engine as `/code-review medium` |

136| `/rewind` | Rewind the conversation and/or code to a previous point, or summarize from a selected message. See [checkpointing](https://code.claude.com/docs/en/checkpointing.md). Aliases: `/checkpoint`, `/undo` |136| `/rewind` | Rewind the conversation and/or code to a previous point, or summarize from a selected message. See [checkpointing](https://code.claude.com/docs/en/checkpointing.md). Aliases: `/checkpoint`, `/undo` |


159| `/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](https://code.claude.com/docs/en/terminal-config.md#create-a-custom-theme) from `~/.claude/themes/` or plugins. Select **New custom theme…** to create one |159| `/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](https://code.claude.com/docs/en/terminal-config.md#create-a-custom-theme) from `~/.claude/themes/` or plugins. Select **New custom theme…** to create one |

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

161| `/ultraplan <prompt>` | Removed. Use [plan mode](https://code.claude.com/docs/en/permission-modes.md#analyze-before-you-edit-with-plan-mode) instead. Previously sent a planning task to a [cloud session](https://code.claude.com/docs/en/claude-code-on-the-web.md) for review in your browser |161| `/ultraplan <prompt>` | Removed. Use [plan mode](https://code.claude.com/docs/en/permission-modes.md#analyze-before-you-edit-with-plan-mode) instead. Previously sent a planning task to a [cloud session](https://code.claude.com/docs/en/claude-code-on-the-web.md) for review in your browser |

162| `/ultrareview [PR or branch]` | Run a deep, multi-agent code review in a cloud sandbox with [ultrareview](https://code.claude.com/docs/en/ultrareview.md). Pass a PR reference to review that pull request, or a base branch or commit to change the comparison base. The preferred invocation is `/code-review ultra`, and `/ultrareview` is an alias. Includes 3 free runs on Pro and Max, then requires [usage credits](https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans) |162| `/ultrareview [PR or branch]` | Run a deep, multi-agent code review in a cloud sandbox with [ultrareview](https://code.claude.com/docs/en/ultrareview.md). Pass a PR reference to review that pull request, or a base branch or commit to change the comparison base. The preferred invocation is `/code-review ultra`, and `/ultrareview` is an alias. Includes 3 free runs on Pro, Max, and Ultra, then requires [usage credits](https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans) |

163| `/update-config [request]` | **[Skill](https://code.claude.com/docs/en/skills.md#bundled-skills).** Describe a settings change, such as allowing a command, setting an environment variable, or adding a [hook](https://code.claude.com/docs/en/hooks.md), and Claude edits the matching [`settings.json`](https://code.claude.com/docs/en/settings) file. For options such as theme and model, use `/config` instead |163| `/update-config [request]` | **[Skill](https://code.claude.com/docs/en/skills.md#bundled-skills).** Describe a settings change, such as allowing a command, setting an environment variable, or adding a [hook](https://code.claude.com/docs/en/hooks.md), and Claude edits the matching [`settings.json`](https://code.claude.com/docs/en/settings) file. For options such as theme and model, use `/config` instead |

164| `/upgrade` | Open the upgrade page in your browser to switch to a higher plan tier. When the browser fails to open, the command shows a sign-in prompt without printing the URL |164| `/upgrade` | Open the upgrade page in your browser to switch to a higher plan tier. When the browser fails to open, the command shows a sign-in prompt without printing the URL |

165| `/usage` | Show session cost, plan usage limits, and activity stats. On a Pro, Max, Team, or Enterprise plan, includes a [breakdown of what counts against your plan limits](https://code.claude.com/docs/en/costs.md#plan-usage-breakdown). `/cost` and `/stats` are aliases |165| `/usage` | Show session cost, plan usage limits, and activity stats. On a Pro, Max, Ultra, Team, or Enterprise plan, includes a [breakdown of what counts against your plan limits](https://code.claude.com/docs/en/costs.md#plan-usage-breakdown). `/cost` and `/stats` are aliases |

166| `/usage-credits` | Configure usage credits, or request them from your admin, when you hit a limit. Opens your [usage-credits billing settings](https://code.claude.com/docs/en/costs.md#add-usage-credits-to-your-subscription) in the browser, except that Team and Enterprise members without billing access instead send a usage-credits request to their admin from the CLI, after confirming in a dialog that the request notifies their admins. When no browser can open the billing page, for example over SSH, the command prints the URL to visit instead; this requires Claude Code v2.1.205 or later, and earlier versions showed nothing in that case. Previously `/extra-usage` |166| `/usage-credits` | Configure usage credits, or request them from your admin, when you hit a limit. Opens your [usage-credits billing settings](https://code.claude.com/docs/en/costs.md#add-usage-credits-to-your-subscription) in the browser, except that Team and Enterprise members without billing access instead send a usage-credits request to their admin from the CLI, after confirming in a dialog that the request notifies their admins. When no browser can open the billing page, for example over SSH, the command prints the URL to visit instead; this requires Claude Code v2.1.205 or later, and earlier versions showed nothing in that case. Previously `/extra-usage` |

167| `/verify` | **[Skill](https://code.claude.com/docs/en/skills.md#bundled-skills).** Confirm a code change does what it should by building your project's app, running it, and observing the result, rather than relying on tests or type checks. See [Run and verify your app](https://code.claude.com/docs/en/skills.md#run-and-verify-your-app) |167| `/verify` | **[Skill](https://code.claude.com/docs/en/skills.md#bundled-skills).** Confirm a code change does what it should by building your project's app, running it, and observing the result, rather than relying on tests or type checks. See [Run and verify your app](https://code.claude.com/docs/en/skills.md#run-and-verify-your-app) |

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

Details

500 500 

501## Next steps501## Next steps

502 502 

503> **[Best practices](https://code.claude.com/docs/en/best-practices.md)**503> [card] [Best practices](https://code.claude.com/docs/en/best-practices.md)

504>504>

505> Patterns for getting the most out of Claude Code505> Patterns for getting the most out of Claude Code

506 506 

507> **[Manage sessions](https://code.claude.com/docs/en/sessions.md)**507> [card] [Manage sessions](https://code.claude.com/docs/en/sessions.md)

508>508>

509> Resume, name, and branch conversations509> Resume, name, and branch conversations

510 510 

511> **[Worktrees](https://code.claude.com/docs/en/worktrees.md)**511> [card] [Worktrees](https://code.claude.com/docs/en/worktrees.md)

512>512>

513> Run isolated parallel sessions513> Run isolated parallel sessions

514 514 

515> **[Extend Claude Code](https://code.claude.com/docs/en/features-overview.md)**515> [card] [Extend Claude Code](https://code.claude.com/docs/en/features-overview.md)

516>516>

517> Add skills, hooks, MCP, subagents, and plugins517> Add skills, hooks, MCP, subagents, and plugins

communications-kit.md +106 −106

Details

33 33 

34Use this as your standard org-wide rollout message. It covers what Claude Code is, gives a two-minute install path, hands readers one concrete task to try, and answers "where does my code go?" before anyone has to ask.34Use this as your standard org-wide rollout message. It covers what Claude Code is, gives a two-minute install path, hands readers one concrete task to try, and answers "where does my code go?" before anyone has to ask.

35 35 

36**Email**36> [tab] Email

37 37>

38```text theme={null}38> ```text theme={null}

39Subject: Claude Code is live for [Engineering / your team]39> Subject: Claude Code is live for [Engineering / your team]

40 40>

41Team,41> Team,

42 42>

43As of today you have access to Claude Code, an AI coding agent that runs in43> As of today you have access to Claude Code, an AI coding agent that runs in

44your terminal, reads your actual codebase, and works through real tasks end44> your terminal, reads your actual codebase, and works through real tasks end

45to end: debugging, refactors, tests, PRs. It is not autocomplete and it is45> to end: debugging, refactors, tests, PRs. It is not autocomplete and it is

46not a chat window. It edits files and runs your commands.46> not a chat window. It edits files and runs your commands.

47 47>

48Get running in two minutes:48> Get running in two minutes:

49 49>

50 curl -fsSL https://claude.ai/install.sh | bash50> curl -fsSL https://claude.ai/install.sh | bash

51 cd <your-repo>51> cd <your-repo>

52 claude52> claude

53 53>

54Then run /init once. Claude reads your project and writes a CLAUDE.md with54> Then run /init once. Claude reads your project and writes a CLAUDE.md with

55your build commands and conventions, so you stop re-explaining the basics.55> your build commands and conventions, so you stop re-explaining the basics.

56 56>

57Then try one of these on the repo you are already in:57> Then try one of these on the repo you are already in:

58 58>

59 - "The test in [file] is flaky. Figure out why and fix it"59> - "The test in [file] is flaky. Figure out why and fix it"

60 - "Walk me through how [module] handles [X]"60> - "Walk me through how [module] handles [X]"

61 - "Look at my working diff and tell me what's risky before I push"61> - "Look at my working diff and tell me what's risky before I push"

62 62>

63Where your code goes: Claude Code runs in your terminal and talks directly63> Where your code goes: Claude Code runs in your terminal and talks directly

64to Anthropic's API. On our Team or Enterprise plan, Anthropic does not use64> to Anthropic's API. On our Team or Enterprise plan, Anthropic does not use

65your code or prompts to train its models.65> your code or prompts to train its models.

66Details: https://code.claude.com/docs/en/data-usage66> Details: https://code.claude.com/docs/en/data-usage

67 https://code.claude.com/docs/en/security67> https://code.claude.com/docs/en/security

68 68>

69Where to go with questions: #claude-code. [Owner name] is watching it69> Where to go with questions: #claude-code. [Owner name] is watching it

70this week.70> this week.

71 71>

72- [Name]72> - [Name]

73 73>

74P.S. Prefer your editor? There is a VS Code extension and a JetBrains74> P.S. Prefer your editor? There is a VS Code extension and a JetBrains

75plugin. Same agent, no terminal required.75> plugin. Same agent, no terminal required.

76```76> ```

77 

78**Slack or Teams**

79 

80```markdown theme={null}

81🚀 *Claude Code is live for [team]*

82 

83AI coding agent, runs in your terminal, reads your repo, does real work:

84bugs, refactors, tests, PRs.

85 

86`curl -fsSL https://claude.ai/install.sh | bash` → `cd your-repo` → `claude`

87 

88*First thing to try* → run `/init`, then: "the test in [file] is flaky,

89figure out why and fix it."

90 

91🔒 Runs in your terminal, talks directly to Anthropic's API. On our Team or

92Enterprise plan, your code and prompts are not used to train models.

93Data usage → https://code.claude.com/docs/en/data-usage

94 

95📚 Quickstart · VS Code · Free 1-hr course

96 https://code.claude.com/docs/en/quickstart

97 https://code.claude.com/docs/en/vs-code

98 https://academy.claude.com/courses/claude-code-in-action

99 77 

100Questions → this thread. [Owner] is on point.78> [tab] Slack or Teams

101```79>

80> ```markdown theme={null}

81> 🚀 *Claude Code is live for [team]*

82>

83> AI coding agent, runs in your terminal, reads your repo, does real work:

84> bugs, refactors, tests, PRs.

85>

86> `curl -fsSL https://claude.ai/install.sh | bash` → `cd your-repo` → `claude`

87>

88> *First thing to try* → run `/init`, then: "the test in [file] is flaky,

89> figure out why and fix it."

90>

91> 🔒 Runs in your terminal, talks directly to Anthropic's API. On our Team or

92> Enterprise plan, your code and prompts are not used to train models.

93> Data usage → https://code.claude.com/docs/en/data-usage

94>

95> 📚 Quickstart · VS Code · Free 1-hr course

96> https://code.claude.com/docs/en/quickstart

97> https://code.claude.com/docs/en/vs-code

98> https://academy.claude.com/courses/claude-code-in-action

99>

100> Questions → this thread. [Owner] is on point.

101> ```

102 102 

103### Executive sponsor variant103### Executive sponsor variant

104 104 


106 106 

107This version is deliberately stripped to one ask: install it and run it on one real task. The exec's job is to make the ask land; the standard announcement and `#claude-code` handle the how.107This version is deliberately stripped to one ask: install it and run it on one real task. The exec's job is to make the ask land; the standard announcement and `#claude-code` handle the how.

108 108 

109**Email**109> [tab] Email

110 110>

111```text theme={null}111> ```text theme={null}

112Subject: One thing I'd like every engineer to try this week112> Subject: One thing I'd like every engineer to try this week

113 113>

114Team,114> Team,

115 115>

116We have turned on Claude Code for all of engineering. It is an AI agent116> We have turned on Claude Code for all of engineering. It is an AI agent

117that works directly in your terminal, on your actual codebase, and the117> that works directly in your terminal, on your actual codebase, and the

118early results from teams already using it are strong enough that I want118> early results from teams already using it are strong enough that I want

119everyone on it this week.119> everyone on it this week.

120 120>

121I am asking for ten minutes:121> I am asking for ten minutes:

122 122>

123 curl -fsSL https://claude.ai/install.sh | bash123> curl -fsSL https://claude.ai/install.sh | bash

124 cd <your-repo>124> cd <your-repo>

125 claude125> claude

126 126>

127Then hand it one real task: the bug you have been putting off, or "walk me127> Then hand it one real task: the bug you have been putting off, or "walk me

128through how [module] works."128> through how [module] works."

129 129>

130That is the whole ask. [Owner name] and team are in #claude-code for130> That is the whole ask. [Owner name] and team are in #claude-code for

131anything you hit along the way.131> anything you hit along the way.

132 132>

133- [Exec Name]133> - [Exec Name]

134 [Title]134> [Title]

135```135> ```

136 

137**Slack or Teams**

138 

139```markdown theme={null}

140📣 *From [Exec Name]: one thing to try this week*

141 

142We have turned on *Claude Code* for all of engineering. Early results are

143strong enough that I am asking everyone to give it ten minutes on real

144work this week.

145 

146`curl -fsSL https://claude.ai/install.sh | bash` → `cd your-repo` →

147`claude` → hand it one real task.

148 136 

149That's it. Questions → #claude-code.137> [tab] Slack or Teams

150```138>

139> ```markdown theme={null}

140> 📣 *From [Exec Name]: one thing to try this week*

141>

142> We have turned on *Claude Code* for all of engineering. Early results are

143> strong enough that I am asking everyone to give it ten minutes on real

144> work this week.

145>

146> `curl -fsSL https://claude.ai/install.sh | bash` → `cd your-repo` →

147> `claude` → hand it one real task.

148>

149> That's it. Questions → #claude-code.

150> ```

151 151 

152### Pilot group variant152### Pilot group variant

153 153 

computer-use.md +2 −2

Details

8 8 

9> [!NOTE]9> [!NOTE]

10>10>

11> Computer use is a research preview on macOS that requires a Pro or Max plan. It is not available on Team or Enterprise plans. It requires an interactive session, so it is not available in non-interactive mode with the `-p` flag.11> Computer use is a research preview on macOS that requires a Pro, Max, or Ultra plan. It is not available on Team or Enterprise plans. It requires an interactive session, so it is not available in non-interactive mode with the `-p` flag.

12 12 

13Computer use lets Claude open apps, control your screen, and work on your machine the way you would. From the CLI, Claude can compile a Swift app, launch it, click through every button, and screenshot the result, all in the same conversation where it wrote the code.13Computer use lets Claude open apps, control your screen, and work on your machine the way you would. From the CLI, Claude can compile a Swift app, launch it, click through every button, and screenshot the result, all in the same conversation where it wrote the code.

14 14 


198The server only appears on eligible setups. Check that:198The server only appears on eligible setups. Check that:

199 199 

200* You're on macOS. Computer use in the CLI is not available on Linux or Windows. On Windows, use [computer use in Desktop](https://code.claude.com/docs/en/desktop.md#let-claude-use-your-computer) instead.200* You're on macOS. Computer use in the CLI is not available on Linux or Windows. On Windows, use [computer use in Desktop](https://code.claude.com/docs/en/desktop.md#let-claude-use-your-computer) instead.

201* You're on a Pro or Max plan. Run `/status` to confirm your subscription.201* You're on a Pro, Max, or Ultra plan. Run `/status` to confirm your subscription.

202* You're authenticated through claude.ai. Computer use is not available with third-party providers like Amazon Bedrock, Google Cloud's Agent Platform, or Microsoft Foundry. If you access Claude exclusively through a third-party provider, you need a separate claude.ai account to use this feature.202* You're authenticated through claude.ai. Computer use is not available with third-party providers like Amazon Bedrock, Google Cloud's Agent Platform, or Microsoft Foundry. If you access Claude exclusively through a third-party provider, you need a separate claude.ai account to use this feature.

203* You're in an interactive session. Computer use is not available in non-interactive mode with the `-p` flag.203* You're in an interactive session. Computer use is not available in non-interactive mode with the `-p` flag.

204 204 

costs.md +50 −50

Details

6 6 

7> Track token usage, set team spend limits, and reduce Claude Code costs with context management, model selection, extended thinking settings, and preprocessing hooks.7> Track token usage, set team spend limits, and reduce Claude Code costs with context management, model selection, extended thinking settings, and preprocessing hooks.

8 8 

9Claude Code charges by API token consumption. For subscription plan pricing (Pro, Max, Team, Enterprise), see [claude.com/pricing](https://claude.com/pricing). Per-developer costs vary widely based on model selection, codebase size, and usage patterns such as running multiple instances or automation.9Claude Code charges by API token consumption. For subscription plan pricing (Pro, Max, Ultra, Team, Enterprise), see [claude.com/pricing](https://claude.com/pricing). Per-developer costs vary widely based on model selection, codebase size, and usage patterns such as running multiple instances or automation.

10 10 

11Across enterprise deployments, the average cost is around \$13 per developer per active day and \$150-250 per developer per month, with costs remaining below \$30 per active day for 90% of users. To estimate spend for your own team, start with a small pilot group and use the tracking tools below to establish a baseline before wider rollout.11Across enterprise deployments, the average cost is around \$13 per developer per active day and \$150-250 per developer per month, with costs remaining below \$30 per active day for 90% of users. To estimate spend for your own team, start with a small pilot group and use the tracking tools below to establish a baseline before wider rollout.

12 12 


18 18 

19> [!NOTE]19> [!NOTE]

20>20>

21> 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, activity stats, and a usage breakdown on the same screen.21> The Session block in `/usage` shows API token usage and is intended for API users. Claude Pro, Max, and Ultra subscribers have usage included in their subscription, so the session cost figure isn't relevant for billing purposes. Subscribers see plan usage bars, activity stats, and a usage breakdown on the same screen.

22 22 

23The Session block at the top of `/usage` shows detailed token usage statistics for your current session. Claude Code computes the dollar figure locally from token counts at list price, unless a [`modelPricing`](https://code.claude.com/docs/en/settings-reference#modelpricing) table is in effect. An administrator sets one in your organization's managed settings so the figure uses your contracted rates, and while a table is in effect the `Total cost` line carries the note `at your organization's configured rates`. The figure is an estimate, so for authoritative billing see the Usage page in the [Claude Console](https://platform.claude.com/usage).23The Session block at the top of `/usage` shows detailed token usage statistics for your current session. Claude Code computes the dollar figure locally from token counts at list price, unless a [`modelPricing`](https://code.claude.com/docs/en/settings-reference#modelpricing) table is in effect. An administrator sets one in your organization's managed settings so the figure uses your contracted rates, and while a table is in effect the `Total cost` line carries the note `at your organization's configured rates`. The figure is an estimate, so for authoritative billing see the Usage page in the [Claude Console](https://platform.claude.com/usage).

24 24 


55 55 

56#### Plan usage breakdown56#### Plan usage breakdown

57 57 

58On a Pro, Max, Team, or Enterprise plan, `/usage` also shows a breakdown of what counts against your plan limits, with recommendations:58On a Pro, Max, Ultra, Team, or Enterprise plan, `/usage` also shows a breakdown of what counts against your plan limits, with recommendations:

59 59 

60* **Attribution**: recent usage attributed to skills, subagents, plugins, and individual MCP servers, each shown as a percentage of the total. An MCP server's share counts only the requests that consumed one of its tool results. Before v2.1.222, after one call to an MCP server, Claude Code attributed every subsequent request to that server, overstating its share.60* **Attribution**: recent usage attributed to skills, subagents, plugins, and individual MCP servers, each shown as a percentage of the total. An MCP server's share counts only the requests that consumed one of its tool results. Before v2.1.222, after one call to an MCP server, Claude Code attributed every subsequent request to that server, overstating its share.

61* **Recommendations**: suggested changes, one per row. Each row starts with a share of your recent usage, at least 10%, as in `25% Trim ~/code/api/CLAUDE.md · 49k tokens per request`.61* **Recommendations**: suggested changes, one per row. Each row starts with a share of your recent usage, at least 10%, as in `25% Trim ~/code/api/CLAUDE.md · 49k tokens per request`.


92 92 

93`/usage` also shows a usage-credits row while [usage credits](#add-usage-credits-to-your-subscription) are on. What the row shows depends on your plan:93`/usage` also shows a usage-credits row while [usage credits](#add-usage-credits-to-your-subscription) are on. What the row shows depends on your plan:

94 94 

95* **Pro and Max**: your spend for the current month, measured against your monthly spend limit when you have set one. When you haven't set a limit, the row shows `Unlimited` and no spend figure.95* **Pro, Max, and Ultra**: your spend for the current month, measured against your monthly spend limit when you have set one. When you haven't set a limit, the row shows `Unlimited` and no spend figure.

96* **Team and Enterprise**: your own spend for the current month, measured against any [limit your organization set](#claude-for-teams-and-enterprise) that applies to you. A limit that covers the whole organization doesn't appear in the row. When you have no limit of your own, the row shows your spend with no limit beside it. While usage credits are off for you, `/usage` shows no usage-credits row.96* **Team and Enterprise**: your own spend for the current month, measured against any [limit your organization set](#claude-for-teams-and-enterprise) that applies to you. A limit that covers the whole organization doesn't appear in the row. When you have no limit of your own, the row shows your spend with no limit beside it. While usage credits are off for you, `/usage` shows no usage-credits row.

97 97 

98When you have a spend limit, the row appears as soon as usage credits are on and shows 0% until you first spend usage credits. Before v2.1.236, `/usage` showed the row only on Pro and Max plans, and a row with a spend limit stayed hidden until you had spent something.98When you have a spend limit, the row appears as soon as usage credits are on and shows 0% until you first spend usage credits. Before v2.1.236, `/usage` showed the row only on Pro, Max, and Ultra plans, and a row with a spend limit stayed hidden until you had spent something.

99 99 

100#### When the usage request fails100#### When the usage request fails

101 101 


130 130 

131| Your role | What `/usage-credits` does |131| Your role | What `/usage-credits` does |

132| :- | :- |132| :- | :- |

133| Pro or Max subscriber | Opens [**Settings > Usage**](https://claude.ai/settings/usage) on claude.ai in the browser. In its **Usage credits** section you can turn usage credits on or off and check your credit balance, this month's spend, and your monthly spend limit |133| Pro, Max, or Ultra subscriber | Opens [**Settings > Usage**](https://claude.ai/settings/usage) on claude.ai in the browser. In its **Usage credits** section you can turn usage credits on or off and check your credit balance, this month's spend, and your monthly spend limit |

134| Team or Enterprise member with billing access | Opens your organization's usage settings, [**Organization settings > Usage**](https://claude.ai/admin-settings/usage), in the browser |134| Team or Enterprise member with billing access | Opens your organization's usage settings, [**Organization settings > Usage**](https://claude.ai/admin-settings/usage), in the browser |

135| Team or Enterprise member without billing access | Asks you to confirm, then sends a request to your organization's admins. Before v2.1.211, Claude Code sent the request without a confirmation step |135| Team or Enterprise member without billing access | Asks you to confirm, then sends a request to your organization's admins. Before v2.1.211, Claude Code sent the request without a confirmation step |

136 136 


144 144 

145Which controls you have depends on how your organization accesses Claude Code: a Claude for Teams or Enterprise plan, the Claude Console, or a cloud provider. On Teams and Enterprise plans, usage draws from each member's seat allowance. On the Console and on cloud providers, usage is billed per token to your organization. If your organization mixes sign-in methods, each developer is metered according to the one they authenticated with.145Which controls you have depends on how your organization accesses Claude Code: a Claude for Teams or Enterprise plan, the Claude Console, or a cloud provider. On Teams and Enterprise plans, usage draws from each member's seat allowance. On the Console and on cloud providers, usage is billed per token to your organization. If your organization mixes sign-in methods, each developer is metered according to the one they authenticated with.

146 146 

147The table maps each setup to where you see spend, where you cap it, and how you pull per-user numbers. On an individual Pro or Max plan you have no organization to manage, so track your own usage-credit spend, including [fast mode](https://code.claude.com/docs/en/fast-mode.md#see-where-fast-mode-spend-appears), under [Add usage credits to your subscription](#add-usage-credits-to-your-subscription).147The table maps each setup to where you see spend, where you cap it, and how you pull per-user numbers. On an individual Pro, Max, or Ultra plan you have no organization to manage, so track your own usage-credit spend, including [fast mode](https://code.claude.com/docs/en/fast-mode.md#see-where-fast-mode-spend-appears), under [Add usage credits to your subscription](#add-usage-credits-to-your-subscription).

148 148 

149| Your setup | See spend | Cap spend | Per-user reporting |149| Your setup | See spend | Cap spend | Per-user reporting |

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


294 294 

295For example, this PreToolUse hook filters test output to show only failures:295For example, this PreToolUse hook filters test output to show only failures:

296 296 

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

298 298>

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

300 300>

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

302{302> {

303 "hooks": {303> "hooks": {

304 "PreToolUse": [304> "PreToolUse": [

305 {305> {

306 "matcher": "Bash",306> "matcher": "Bash",

307 "hooks": [307> "hooks": [

308 {308> {

309 "type": "command",309> "type": "command",

310 "command": "~/.claude/hooks/filter-test-output.sh"310> "command": "~/.claude/hooks/filter-test-output.sh"

311 }311> }

312 ]312> ]

313 }313> }

314 ]314> ]

315 }315> }

316}316> }

317```317> ```

318 318 

319**filter-test-output.sh**319> [tab] filter-test-output.sh

320 320>

321The hook calls this script. Create the folder with `mkdir -p ~/.claude/hooks`, save the script below as `~/.claude/hooks/filter-test-output.sh`, and make it executable with `chmod +x ~/.claude/hooks/filter-test-output.sh`. It checks if the command is a test runner and modifies it to show only failures:321> The hook calls this script. Create the folder with `mkdir -p ~/.claude/hooks`, save the script below as `~/.claude/hooks/filter-test-output.sh`, and make it executable with `chmod +x ~/.claude/hooks/filter-test-output.sh`. It checks if the command is a test runner and modifies it to show only failures:

322 322>

323```bash theme={null}323> ```bash theme={null}

324#!/bin/bash324> #!/bin/bash

325input=$(cat)325> input=$(cat)

326cmd=$(echo "$input" | jq -r '.tool_input.command')326> cmd=$(echo "$input" | jq -r '.tool_input.command')

327 327>

328# If running tests, filter to show only failures328> # If running tests, filter to show only failures

329pattern='^(npm test|pytest|go test)( [^;&|<>`$#\\[:cntrl:]]*)?$'329> pattern='^(npm test|pytest|go test)( [^;&|<>`$#\\[:cntrl:]]*)?$'

330if [[ "$cmd" =~ $pattern ]]; then330> if [[ "$cmd" =~ $pattern ]]; then

331 filtered_cmd="$cmd 2>&1 | grep -A 5 -E '(FAIL|ERROR|error:)' | head -100"331> filtered_cmd="$cmd 2>&1 | grep -A 5 -E '(FAIL|ERROR|error:)' | head -100"

332 echo "$input" | jq --arg filtered "$filtered_cmd" \332> echo "$input" | jq --arg filtered "$filtered_cmd" \

333 '{hookSpecificOutput: {hookEventName: "PreToolUse", updatedInput: (.tool_input + {command: $filtered})}}'333> '{hookSpecificOutput: {hookEventName: "PreToolUse", updatedInput: (.tool_input + {command: $filtered})}}'

334else334> else

335 echo "{}"335> echo "{}"

336fi336> fi

337```337> ```

338 338 

339To verify the setup, run `/hooks` and check that the hook appears under PreToolUse. You can also start Claude Code with `claude --debug-file ./claude-debug.txt` and ask Claude to run `npm test`. When the hook rewrites the command, that log file contains a `modified tool input keys` line listing `command` and the other Bash input fields.339To verify the setup, run `/hooks` and check that the hook appears under PreToolUse. You can also start Claude Code with `claude --debug-file ./claude-debug.txt` and ask Claude to run `npm test`. When the hook rewrites the command, that log file contains a `modified tool input keys` line listing `command` and the other Bash input fields.

340 340 


392* **Agent teammates**: each active [teammate](#agent-team-token-costs) keeps consuming tokens until it exits392* **Agent teammates**: each active [teammate](#agent-team-token-costs) keeps consuming tokens until it exits

393* **Compaction**: `/compact` reads the conversation it summarizes, so [compacting a large context](https://code.claude.com/docs/en/prompt-caching.md#compacting-the-conversation) is itself a large request. When you want a fresh start instead of continuity, `/clear` costs nothing393* **Compaction**: `/compact` reads the conversation it summarizes, so [compacting a large context](https://code.claude.com/docs/en/prompt-caching.md#compacting-the-conversation) is itself a large request. When you want a fresh start instead of continuity, `/clear` costs nothing

394 394 

395On a Pro, Max, Team, or Enterprise plan, the [`/usage` breakdown](#plan-usage-breakdown) recommends a change for behaviors behind 10% or more of your recent usage, such as long context or cache misses.395To see what to change on a Pro, Max, Ultra, Team, or Enterprise plan, run [`/usage`](#plan-usage-breakdown) at the Claude Code prompt. Its breakdown recommends a change for behaviors behind 10% or more of your recent usage. Those behaviors include long context and cache misses.

396 396 

397## Understanding changes in Claude Code behavior397## Understanding changes in Claude Code behavior

398 398 


400 400 

401For billing questions about your specific account, contact Anthropic support through the in-product messenger:401For billing questions about your specific account, contact Anthropic support through the in-product messenger:

402 402 

403* **Subscription plans** (Pro, Max, Team, Enterprise): sign in at [claude.ai](https://claude.ai), click your initials in the lower left, and select **Get help**403* **Subscription plans** (Pro, Max, Ultra, Team, Enterprise): sign in at [claude.ai](https://claude.ai), click your initials in the lower left, and select **Get help**

404* **Console (API) billing**: sign in at [platform.claude.com](https://platform.claude.com), click your initials, and select **Get help**404* **Console (API) billing**: sign in at [platform.claude.com](https://platform.claude.com), click your initials, and select **Get help**

405 405 

406See [How to get support](https://support.claude.com/en/articles/9015913-how-to-get-support) for the full flow, including who can reach a human agent on each plan.406See [How to get support](https://support.claude.com/en/articles/9015913-how-to-get-support) for the full flow, including who can reach a human agent on each plan.

data-usage.md +6 −6

Details

10 10 

11### Data training policy11### Data training policy

12 12 

13**Consumer users (Free, Pro, and Max plans)**:13**Consumer users (Free, Pro, Max, and Ultra plans)**:

14We give you the choice to allow your data to be used to improve future Claude models. We will train new models using data from Free, Pro, and Max accounts when this setting is on (including when you use Claude Code from these accounts).14We give you the choice to allow your data to be used to improve future Claude models. We will train new models using data from Free, Pro, Max, and Ultra accounts when this setting is on (including when you use Claude Code from these accounts).

15 15 

16**Commercial users**: (Team and Enterprise plans, API, 3rd-party platforms, and Claude Gov) maintain existing policies: Anthropic does not train generative models using code or prompts sent to Claude Code under commercial terms, unless the customer has chosen to provide their data to us for model improvement (for example, the [Developer Partner Program](https://support.claude.com/en/articles/11174108-about-the-development-partner-program)).16**Commercial users**: (Team and Enterprise plans, API, 3rd-party platforms, and Claude Gov) maintain existing policies: Anthropic does not train generative models using code or prompts sent to Claude Code under commercial terms, unless the customer has chosen to provide their data to us for model improvement (for example, the [Developer Partner Program](https://support.claude.com/en/articles/11174108-about-the-development-partner-program)).

17 17 


43 43 

44Anthropic retains Claude Code data based on your account type and preferences.44Anthropic retains Claude Code data based on your account type and preferences.

45 45 

46**Consumer users (Free, Pro, and Max plans)**:46**Consumer users (Free, Pro, Max, and Ultra plans)**:

47 47 

48* Users who allow data use for model improvement: 5-year retention period to support model development and safety improvements48* Users who allow data use for model improvement: 5-year retention period to support model development and safety improvements

49* Users who don't allow data use for model improvement: 30-day retention period49* Users who don't allow data use for model improvement: 30-day retention period


61 61 

62Learn more about data retention practices in our [Privacy Center](https://privacy.anthropic.com/).62Learn more about data retention practices in our [Privacy Center](https://privacy.anthropic.com/).

63 63 

64For full details, please review our [Commercial Terms of Service](https://www.anthropic.com/legal/commercial-terms) (for Team, Enterprise, and API users) or [Consumer Terms](https://www.anthropic.com/legal/consumer-terms) (for Free, Pro, and Max users) and [Privacy Policy](https://www.anthropic.com/legal/privacy).64For full details, please review our [Commercial Terms of Service](https://www.anthropic.com/legal/commercial-terms) (for Team, Enterprise, and API users) or [Consumer Terms](https://www.anthropic.com/legal/consumer-terms) (for Free, Pro, Max, and Ultra users) and [Privacy Policy](https://www.anthropic.com/legal/privacy).

65 65 

66## Data access66## Data access

67 67 


107 107 

108Error reporting is on only when all of these apply:108Error reporting is on only when all of these apply:

109 109 

110* you sign in with a Claude Pro or Max subscription110* you sign in with a Claude Pro, Max, or Ultra subscription

111* you're running Claude Code v2.1.198 or later111* you're running Claude Code v2.1.198 or later

112* you're connecting directly to the Claude API112* you're connecting directly to the Claude API

113* your organization doesn't have a zero data retention or HIPAA agreement113* your organization doesn't have a zero data retention or HIPAA agreement


123| Service | Claude API | Google Cloud's Agent Platform API | Amazon Bedrock API | Microsoft Foundry API | Claude Platform on AWS |123| Service | Claude API | Google Cloud's Agent Platform API | Amazon Bedrock API | Microsoft Foundry API | Claude Platform on AWS |

124| - | - | - | - | - | - |124| - | - | - | - | - | - |

125| **Metrics** | Default on. `DISABLE_TELEMETRY=1` to disable. | Default off. `CLAUDE_CODE_USE_VERTEX` must be 1. | Default off. `CLAUDE_CODE_USE_BEDROCK` must be 1. | Default off. `CLAUDE_CODE_USE_FOUNDRY` must be 1. | Default off. `CLAUDE_CODE_USE_ANTHROPIC_AWS` must be 1. |125| **Metrics** | Default on. `DISABLE_TELEMETRY=1` to disable. | Default off. `CLAUDE_CODE_USE_VERTEX` must be 1. | Default off. `CLAUDE_CODE_USE_BEDROCK` must be 1. | Default off. `CLAUDE_CODE_USE_FOUNDRY` must be 1. | Default off. `CLAUDE_CODE_USE_ANTHROPIC_AWS` must be 1. |

126| **Error reports** | On for Pro and Max sign-ins on v2.1.198+, otherwise off. `DISABLE_ERROR_REPORTING=1` to disable. | Default off. `CLAUDE_CODE_USE_VERTEX` must be 1. | Default off. `CLAUDE_CODE_USE_BEDROCK` must be 1. | Default off. `CLAUDE_CODE_USE_FOUNDRY` must be 1. | Default off. `CLAUDE_CODE_USE_ANTHROPIC_AWS` must be 1. |126| **Error reports** | On for Pro, Max, and Ultra sign-ins on v2.1.198+, otherwise off. `DISABLE_ERROR_REPORTING=1` to disable. | Default off. `CLAUDE_CODE_USE_VERTEX` must be 1. | Default off. `CLAUDE_CODE_USE_BEDROCK` must be 1. | Default off. `CLAUDE_CODE_USE_FOUNDRY` must be 1. | Default off. `CLAUDE_CODE_USE_ANTHROPIC_AWS` must be 1. |

127| **Claude API (`/feedback` reports)** | Default on. `DISABLE_FEEDBACK_COMMAND=1` to disable. | Default off. `CLAUDE_CODE_USE_VERTEX` must be 1. | Default off. `CLAUDE_CODE_USE_BEDROCK` must be 1. | Default off. `CLAUDE_CODE_USE_FOUNDRY` must be 1. | Default off. `CLAUDE_CODE_USE_ANTHROPIC_AWS` must be 1. |127| **Claude API (`/feedback` reports)** | Default on. `DISABLE_FEEDBACK_COMMAND=1` to disable. | Default off. `CLAUDE_CODE_USE_VERTEX` must be 1. | Default off. `CLAUDE_CODE_USE_BEDROCK` must be 1. | Default off. `CLAUDE_CODE_USE_FOUNDRY` must be 1. | Default off. `CLAUDE_CODE_USE_ANTHROPIC_AWS` must be 1. |

128| **Session quality surveys** | Default on. `CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY=1` to disable. | Default on. `CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY=1` to disable. | Default on. `CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY=1` to disable. | Default on. `CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY=1` to disable. | Default on. `CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY=1` to disable. |128| **Session quality surveys** | Default on. `CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY=1` to disable. | Default on. `CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY=1` to disable. | Default on. `CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY=1` to disable. | Default on. `CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY=1` to disable. | Default on. `CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY=1` to disable. |

129| **WebFetch domain safety check** | Default on. `skipWebFetchPreflight: true` in [settings](https://code.claude.com/docs/en/settings.md) to disable. | Default on. `skipWebFetchPreflight: true` in [settings](https://code.claude.com/docs/en/settings.md) to disable. | Default on. `skipWebFetchPreflight: true` in [settings](https://code.claude.com/docs/en/settings.md) to disable. | Default on. `skipWebFetchPreflight: true` in [settings](https://code.claude.com/docs/en/settings.md) to disable. | Default on. `skipWebFetchPreflight: true` in [settings](https://code.claude.com/docs/en/settings.md) to disable. |129| **WebFetch domain safety check** | Default on. `skipWebFetchPreflight: true` in [settings](https://code.claude.com/docs/en/settings.md) to disable. | Default on. `skipWebFetchPreflight: true` in [settings](https://code.claude.com/docs/en/settings.md) to disable. | Default on. `skipWebFetchPreflight: true` in [settings](https://code.claude.com/docs/en/settings.md) to disable. | Default on. `skipWebFetchPreflight: true` in [settings](https://code.claude.com/docs/en/settings.md) to disable. | Default on. `skipWebFetchPreflight: true` in [settings](https://code.claude.com/docs/en/settings.md) to disable. |

Details

95 95 

96In your shell, with no Claude Code session running, create the directory and move into it:96In your shell, with no Claude Code session running, create the directory and move into it:

97 97 

98**Bash or Zsh**98> [tab] Bash or Zsh

99 99>

100```bash theme={null}100> ```bash theme={null}

101mkdir -p ~/claude-clean/empty && cd ~/claude-clean/empty101> mkdir -p ~/claude-clean/empty && cd ~/claude-clean/empty

102```102> ```

103 

104**PowerShell**

105 103 

106```powershell theme={null}104> [tab] PowerShell

107New-Item -ItemType Directory -Force "$HOME/claude-clean/empty" | Out-Null105>

108Set-Location "$HOME/claude-clean/empty"106> ```powershell theme={null}

109```107> New-Item -ItemType Directory -Force "$HOME/claude-clean/empty" | Out-Null

108> Set-Location "$HOME/claude-clean/empty"

109> ```

110 110 

111**2. Start Claude Code with a clean configuration directory**111**2. Start Claude Code with a clean configuration directory**

112 112 

113From the same shell, set [`CLAUDE_CONFIG_DIR`](https://code.claude.com/docs/en/env-vars) to a fresh directory in place of `~/.claude`, and pass [`--setting-sources user`](https://code.claude.com/docs/en/cli-reference#cli-flags) to turn off project configuration such as `.claude/settings.json`, `CLAUDE.md`, and `.mcp.json`:113From the same shell, set [`CLAUDE_CONFIG_DIR`](https://code.claude.com/docs/en/env-vars) to a fresh directory in place of `~/.claude`, and pass [`--setting-sources user`](https://code.claude.com/docs/en/cli-reference#cli-flags) to turn off project configuration such as `.claude/settings.json`, `CLAUDE.md`, and `.mcp.json`:

114 114 

115**Bash or Zsh**115> [tab] Bash or Zsh

116 116>

117The variable applies to this one launch.117> The variable applies to this one launch.

118 118>

119```bash theme={null}119> ```bash theme={null}

120CLAUDE_CONFIG_DIR=~/claude-clean/config claude --setting-sources user120> CLAUDE_CONFIG_DIR=~/claude-clean/config claude --setting-sources user

121```121> ```

122 

123**PowerShell**

124 

125The variable stays set for the rest of this PowerShell session, so later `claude` launches in the same window keep using the clean directory. To return to your usual directory, run `Remove-Item Env:CLAUDE_CONFIG_DIR` before the next launch.

126 122 

127```powershell theme={null}123> [tab] PowerShell

128$env:CLAUDE_CONFIG_DIR = "$HOME/claude-clean/config"124>

129claude --setting-sources user125> The variable stays set for the rest of this PowerShell session, so later `claude` launches in the same window keep using the clean directory. To return to your usual directory, run `Remove-Item Env:CLAUDE_CONFIG_DIR` before the next launch.

130```126>

127> ```powershell theme={null}

128> $env:CLAUDE_CONFIG_DIR = "$HOME/claude-clean/config"

129> claude --setting-sources user

130> ```

131 131 

132On the first launch, you go through the first-run setup screens again, a sign that the clean configuration directory is in effect. Managed settings still apply, and [connectors](https://code.claude.com/docs/en/mcp.md#use-mcp-servers-from-claude-ai) still load if you log in with a claude.ai account.132On the first launch, you go through the first-run setup screens again, a sign that the clean configuration directory is in effect. Managed settings still apply, and [connectors](https://code.claude.com/docs/en/mcp.md#use-mcp-servers-from-claude-ai) still load if you log in with a claude.ai account.

133 133 

desktop.md +118 −88

Details

8 8 

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

10 10 

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

12>12>

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

14 14 

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

16>16>

17> For x64 processors17> For x64 processors

18 18 

19> **[Get Claude for Linux (beta)](https://code.claude.com/docs/en/desktop-linux.md)**19> [card] [Get Claude for Linux (beta)](https://code.claude.com/docs/en/desktop-linux.md)

20>20>

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

22 22 


92| **Accept edits** | `acceptEdits` | Claude auto-accepts file edits and common filesystem commands like `mkdir`, `touch`, and `mv`, but still asks before running other terminal commands. Use this when you trust file changes and want faster iteration. |92| **Accept edits** | `acceptEdits` | Claude auto-accepts file edits and common filesystem commands like `mkdir`, `touch`, and `mv`, but still asks before running other terminal commands. Use this when you trust file changes and want faster iteration. |

93| **Plan** | `plan` | Claude reads files and runs commands to explore, then proposes a plan without editing your source code. Good for complex tasks where you want to review the approach first. |93| **Plan** | `plan` | Claude reads files and runs commands to explore, then proposes a plan without editing your source code. Good for complex tasks where you want to review the approach first. |

94| **Auto** | `auto` | Claude runs without routine prompts; before actions such as shell commands and network requests run, a background classifier checks that they align with your request. Appears when [auto mode is available](#auto-mode-availability); there is no separate Settings toggle for it. |94| **Auto** | `auto` | Claude runs without routine prompts; before actions such as shell commands and network requests run, a background classifier checks that they align with your request. Appears when [auto mode is available](#auto-mode-availability); there is no separate Settings toggle for it. |

95| **Bypass permissions** | `bypassPermissions` | Claude runs without permission prompts, except for the [actions no mode auto-approves](https://code.claude.com/docs/en/permission-modes.md#actions-no-mode-auto-approves), safety classifiers when Claude [acts on external sites](#browse-external-sites), or desktop actions such as deleting a session, though not [archiving one](#work-across-sessions). Equivalent to `--dangerously-skip-permissions` in the CLI. On Pro and Max plans, enable "Allow bypass permissions mode" in **Settings > Code** or **Settings > Claude Code**. On Team and Enterprise plans there is no Settings toggle, and organization policy controls it instead. Only use this in sandboxed containers or VMs. |95| **Bypass permissions** | `bypassPermissions` | Claude runs without permission prompts, except for the [actions no mode auto-approves](https://code.claude.com/docs/en/permission-modes.md#actions-no-mode-auto-approves), safety classifiers when Claude [acts on external sites](#browse-external-sites), or desktop actions such as deleting a session, though not [archiving one](#work-across-sessions). Equivalent to `--dangerously-skip-permissions` in the CLI. On Pro, Max, and Ultra plans, enable "Allow bypass permissions mode" in **Settings > Code** or **Settings > Claude Code**. On Team and Enterprise plans there is no Settings toggle, and organization policy controls it instead. Only use this in sandboxed containers or VMs. |

96 96 

97Earlier versions of the Code tab labeled these modes Ask permissions, Auto accept edits, and Plan mode.97Earlier versions of the Code tab labeled these modes Ask permissions, Auto accept edits, and Plan mode.

98 98 


320 320 

321> [!NOTE]321> [!NOTE]

322>322>

323> Computer use is a research preview on macOS and Windows that requires a Pro or Max plan. It is not available on Team or Enterprise plans. The Claude Desktop app must be running. On macOS, computer use requires macOS 14 or later.323> Computer use is a research preview on macOS and Windows that requires a Pro, Max, or Ultra plan. It is not available on Team or Enterprise plans. The Claude Desktop app must be running. On macOS, computer use requires macOS 14 or later.

324 324 

325Computer use is off by default. [Enable it in Settings](#enable-computer-use) before Claude can control your screen. On macOS, you also need to grant Accessibility and Screen Recording permissions.325Computer use is off by default. [Enable it in Settings](#enable-computer-use) before Claude can control your screen. On macOS, you also need to grant Accessibility and Screen Recording permissions.

326 326 


362* **Windows**: the toggle takes effect immediately and setup is complete362* **Windows**: the toggle takes effect immediately and setup is complete

363* **macOS**: continue to the next step363* **macOS**: continue to the next step

364 364 

365If you don't see the toggle, confirm you're on macOS or Windows with a Pro or Max plan, then update and restart the app.365If you don't see the toggle, confirm you're on macOS or Windows with a Pro, Max, or Ultra plan, then update and restart the app.

366 366 

367**3. Grant macOS permissions**367**3. Grant macOS permissions**

368 368 


562 562 

563#### Set up Dispatch563#### Set up Dispatch

564 564 

565For setup, pairing, and Dispatch settings, see the [Dispatch help article](https://support.claude.com/en/articles/13947068). Dispatch requires a Pro or Max plan and is not available on Team or Enterprise plans.565* **Plans**: Dispatch requires a Pro, Max, or Ultra plan and is not available on Team or Enterprise plans

566* **Setup, pairing, and Dispatch settings**: see the [Dispatch help article](https://support.claude.com/en/articles/13947068)

566 567 

567Dispatch is one of several ways to work with Claude when you're away from your terminal. For a comparison with the other options, see [Platforms and integrations](https://code.claude.com/docs/en/platforms.md#work-when-you-are-away-from-your-terminal).568Dispatch is one of several ways to work with Claude when you're away from your terminal. For a comparison with the other options, see [Platforms and integrations](https://code.claude.com/docs/en/platforms.md#work-when-you-are-away-from-your-terminal).

568 569 


738 739 

739These configurations show common setups for different project types:740These configurations show common setups for different project types:

740 741 

741**Next.js**742> [tab] Next.js

742 743>

743This configuration runs a Next.js app using Yarn on port 3000:744> This configuration runs a Next.js app using Yarn on port 3000:

744 745>

745```json theme={null}746> ```json theme={null}

746{747> {

747 "version": "0.0.1",748> "version": "0.0.1",

748 "configurations": [749> "configurations": [

749 {750> {

750 "name": "web",751> "name": "web",

751 "runtimeExecutable": "yarn",752> "runtimeExecutable": "yarn",

752 "runtimeArgs": ["dev"],753> "runtimeArgs": ["dev"],

753 "port": 3000754> "port": 3000

754 }755> }

755 ]756> ]

756}757> }

757```758> ```

758 759 

759**Multiple servers**760> [tab] Multiple servers

760 761>

761For a monorepo with a frontend and an API server, define multiple configurations. The frontend uses `autoPort: true` so it picks a free port if 3000 is taken, while the API server requires port 8080 exactly:762> For a monorepo with a frontend and an API server, define multiple configurations. The frontend uses `autoPort: true` so it picks a free port if 3000 is taken, while the API server requires port 8080 exactly:

762 763>

763```json theme={null}764> ```json theme={null}

764{765> {

765 "version": "0.0.1",766> "version": "0.0.1",

766 "configurations": [767> "configurations": [

767 {768> {

768 "name": "frontend",769> "name": "frontend",

769 "runtimeExecutable": "npm",770> "runtimeExecutable": "npm",

770 "runtimeArgs": ["run", "dev"],771> "runtimeArgs": ["run", "dev"],

771 "cwd": "apps/web",772> "cwd": "apps/web",

772 "port": 3000,773> "port": 3000,

773 "autoPort": true774> "autoPort": true

774 },775> },

775 {776> {

776 "name": "api",777> "name": "api",

777 "runtimeExecutable": "npm",778> "runtimeExecutable": "npm",

778 "runtimeArgs": ["run", "start"],779> "runtimeArgs": ["run", "start"],

779 "cwd": "server",780> "cwd": "server",

780 "port": 8080,781> "port": 8080,

781 "env": { "NODE_ENV": "development" },782> "env": { "NODE_ENV": "development" },

782 "autoPort": false783> "autoPort": false

783 }784> }

784 ]785> ]

785}786> }

786```787> ```

787 788 

788**Node.js script**789> [tab] Node.js script

789 790>

790To run a Node.js script directly instead of using a package manager command, use the `program` field:791> To run a Node.js script directly instead of using a package manager command, use the `program` field:

791 792>

792```json theme={null}793> ```json theme={null}

793{794> {

794 "version": "0.0.1",795> "version": "0.0.1",

795 "configurations": [796> "configurations": [

796 {797> {

797 "name": "server",798> "name": "server",

798 "program": "server.js",799> "program": "server.js",

799 "args": ["--verbose"],800> "args": ["--verbose"],

800 "port": 4000801> "port": 4000

801 }802> }

802 ]803> ]

803}804> }

804```805> ```

805 806 

806## Environment configuration807## Environment configuration

807 808 


1327* **Workflows**: Desktop checks each new [workflow](https://code.claude.com/docs/en/workflows.md) before it starts, so while Desktop is disconnected a new one waits up to 10 minutes and then fails1328* **Workflows**: Desktop checks each new [workflow](https://code.claude.com/docs/en/workflows.md) before it starts, so while Desktop is disconnected a new one waits up to 10 minutes and then fails

1328* **MCP servers**: MCP servers that Claude Code starts on the remote machine don't run through Desktop, so Claude can still call their tools. Servers from `claude_desktop_config.json` are among them only if Desktop doesn't use its [built-in SSH client](#worktree-edits-while-disconnected). Otherwise, and on [some Windows remote machines](#windows-remote-machines), Claude can't call their tools while Desktop is disconnected.1329* **MCP servers**: MCP servers that Claude Code starts on the remote machine don't run through Desktop, so Claude can still call their tools. Servers from `claude_desktop_config.json` are among them only if Desktop doesn't use its [built-in SSH client](#worktree-edits-while-disconnected). Otherwise, and on [some Windows remote machines](#windows-remote-machines), Claude can't call their tools while Desktop is disconnected.

1329 1330 

1330> **When edits in a worktree keep working**1331> [accordion] When edits in a worktree keep working

1331>1332>

1332> On a Linux or macOS remote machine, the check doesn't go through Desktop, so edits inside the worktree keep working while Desktop is disconnected. Before Claude Desktop v2.37337.0, this holds on a Linux remote machine only.1333> On a Linux or macOS remote machine, the check doesn't go through Desktop, so edits inside the worktree keep working while Desktop is disconnected. Before Claude Desktop v2.37337.0, this holds on a Linux remote machine only.

1333>1334>


1368* **Remembered password**: a password that you let Desktop remember also works without a prompt, but for a long absence prefer a key that your SSH agent holds. If sign-ins with that password break off or hang, Desktop can stop reconnecting and wait for you.1369* **Remembered password**: a password that you let Desktop remember also works without a prompt, but for a long absence prefer a key that your SSH agent holds. If sign-ins with that password break off or hang, Desktop can stop reconnecting and wait for you.

1369* **Any other prompt**: if the remote machine prompts for anything else, such as a one-time code, you can get a notification on your computer. Click the notification, or send a message in the session, and Desktop shows the prompt.1370* **Any other prompt**: if the remote machine prompts for anything else, such as a one-time code, you can get a notification on your computer. Click the notification, or send a message in the session, and Desktop shows the prompt.

1370 1371 

1371> **If a jump host asks for a sign-in, the outage is long, output is missing, or the process is gone**1372> [accordion] If a jump host asks for a sign-in, the outage is long, output is missing, or the process is gone

1372>1373>

1373> * **Jump host, pushes stop while you're away**: this can happen with Desktop on macOS or Linux when nobody answers a jump host's sign-in, for example a push to a phone. Desktop then stops reconnecting while nobody is at your computer. When you unlock or use the computer, you can get another push, because Desktop can try again. After three unanswered attempts it waits until you retry or send a message.1374> * **Jump host, pushes stop while you're away**: this can happen with Desktop on macOS or Linux when nobody answers a jump host's sign-in, for example a push to a phone. Desktop then stops reconnecting while nobody is at your computer. When you unlock or use the computer, you can get another push, because Desktop can try again. After three unanswered attempts it waits until you retry or send a message.

1374> * **Jump host, pushes keep coming**: where Desktop can't tell that nobody answers, as with Desktop on Windows, it keeps trying while it has a process to rejoin, whether or not that process still runs. You can get another push with each attempt. To end the attempts, quit Desktop, which [can cost you the running task](#reopen-a-session-after-you-quit-desktop).1375> * **Jump host, pushes keep coming**: where Desktop can't tell that nobody answers, as with Desktop on Windows, it keeps trying while it has a process to rejoin, whether or not that process still runs. You can get another push with each attempt. To end the attempts, quit Desktop, which [can cost you the running task](#reopen-a-session-after-you-quit-desktop).


1592>1593>

1593> Connections from a command require Claude Desktop v3.6556.0 or later on macOS or Linux, signed in with a Claude account. Administrators can [distribute commands to a team](#distribute-commands-to-your-team).1594> Connections from a command require Claude Desktop v3.6556.0 or later on macOS or Linux, signed in with a Claude account. Administrators can [distribute commands to a team](#distribute-commands-to-your-team).

1594 1595 

1595Each entry is one connection, with one host at a time. Desktop runs the command only when you create the connection or [replace its host](#replace-the-host), not each time you connect. To keep two machines at once, add a second entry.1596Desktop runs the command only when you create the connection or [create another machine](#create-another-machine), not each time you connect. Each entry is one connection, which points at the host that Desktop last saved from the entry's command.

1596 1597 

1597> [!WARNING]1598> [!WARNING]

1598>1599>

1599> Desktop doesn't stop or delete machines. Each of these keeps running, and can keep costing money, until you delete it with your tool:1600> Desktop doesn't stop or delete machines. Each of these keeps running, and can keep costing money, until you delete it with your tool:

1600>1601>

1601> * A host that you replaced1602> * A machine that an entry pointed at before you [created another](#create-another-machine)

1602> * The host of an entry that you removed from the file, or whose `id` you changed1603> * The machines of an entry that you removed from the file, or whose `id` you changed

1603> * A machine that your command made without Desktop saving its host, for example in these cases:1604> * A machine that your command made without Desktop saving its host, for example in these cases:

1604> * The command fails or runs out of time1605> * The command fails or runs out of time

1605> * Desktop can't use the printed host, another connection already uses it, or your organization doesn't allow it1606> * Desktop can't use the printed host, another connection already uses it, or your organization doesn't allow it


1624 1625 

1625| Field | Value |1626| Field | Value |

1626| :- | :- |1627| :- | :- |

1627| `id` | Up to 64 ASCII letters, digits, `.`, `_`, and `-`, starting with a letter or digit. Use an `id` that no other entry in `sshHostCommands` or [`sshConfigs`](#pre-configure-ssh-connections-for-your-team) has. Desktop keeps the connection's host under it, so if you change it, the connection starts over with no host and the old machine keeps running. |1628| `id` | Up to 64 ASCII letters, digits, `.`, `_`, and `-`, starting with a letter or digit. Use an `id` that no other entry in `sshHostCommands` or [`sshConfigs`](#pre-configure-ssh-connections-for-your-team) has. Desktop keeps the connection's host under it, so if you change it, the connection starts over with no host, its machines keep running, and Desktop can [still connect to them](#remove-an-entry). |

1628| `name` | The connection's name in the environment selector, up to 200 characters on one line |1629| `name` | The connection's name in the environment selector, up to 200 characters on one line |

1629| `command` | A program and its arguments, as [Write the command](#write-the-command) describes |1630| `command` | A program and its arguments, as [Write the command](#write-the-command) describes |

1630| `sshIdentityFile` | Path to your private key, such as `~/.ssh/id_ed25519`. Leave it out to use your SSH configuration or SSH agent. |1631| `sshIdentityFile` | Path to your private key, such as `~/.ssh/id_ed25519`. Leave it out to use your SSH configuration or SSH agent. |


1677 1678 

1678Keep host key checking on for these hosts, and keep a `known_hosts` file for them. If `StrictHostKeyChecking` is `no` or `accept-new` and `UserKnownHostsFile` is also `/dev/null` or `none`, nothing records the key. When your tool then reuses a name, you can connect to a different machine without a warning.1679Keep host key checking on for these hosts, and keep a `known_hosts` file for them. If `StrictHostKeyChecking` is `no` or `accept-new` and `UserKnownHostsFile` is also `/dev/null` or `none`, nothing records the key. When your tool then reuses a name, you can connect to a different machine without a warning.

1679 1680 

1680##### Replace the host1681A reused name also matters with nobody at the computer, because Desktop connects to these hosts on its own. For example, it delivers a message that you sent while the host was unreachable, once the host answers. Even with host key checking on, the message can reach the name's new machine in these cases, so [stop using a machine](#stop-using-a-machine) before it's deleted:

1682 

1683* You, your command, or another program added the new key to `known_hosts` or removed the old key's line, as your command does if it adds host keys

1684* Your tool's machines share a host key

1685* Your tool's machines share a certificate authority that `known_hosts` trusts

1686* You or your administrator set `KnownHostsCommand` or `VerifyHostKeyDNS yes`, so SSH accepts keys from outside `known_hosts`

1687 

1688##### Create another machine

1689 

1690Your sessions on earlier machines keep working after you select **Create another Dev box**, and new sessions use the new machine. Select the item in the environment selector to make a fresh machine or to replace one that is gone. On the new-session page, the message that says Desktop can't reach the host offers it too.

1681 1691 

1682Once Dev box has a host, the selector lists Dev box among your SSH connections, and **Create Dev box** becomes **Replace Dev box's host**. If that item isn't in the list, look under **More**.1692* **Sessions on earlier machines**: continue them from the sidebar, because the selector lists Dev box's current machine and not the earlier ones. Desktop can connect to their machines on its own, for example when Desktop starts, so [stop using a machine](#stop-using-a-machine) when you're done with it.

1693* **A host replaced before Claude Desktop v4.4212.0**: those versions show **Replace Dev box's host** and stop connecting to the replaced host. To continue a session on that host, open the session, select **Add SSH connection**, and save the connection that Desktop fills in. Update Desktop before you replace another host.

1694* **New sessions on two machines**: add a second entry to [`sshHostCommands`](#create-an-ssh-connection-from-a-command)

1695* **A new host that doesn't answer yet**: leave the new-session page open for up to 10 minutes while it keeps trying to connect. If the host still doesn't answer, select **Create another Dev box** in the page's message.

1696* **Another machine soon after**: after several runs of the command within an hour, confirm each further run in the dialog that Desktop opens, which shows the command

1683 1697 

1684Select it when the machine is gone or you want a fresh one. On the new-session page, the message that says Desktop can't reach the host offers it too. Desktop runs the command again, and new sessions use the new host.1698##### Stop using a machine

1685 1699 

1686* **A new host**: the item is gray for 10 minutes after Desktop saves a host, because a new machine can take a while to start. While a new host doesn't answer, the new-session page keeps trying to connect for those 10 minutes.1700To stop Desktop from connecting on its own to a machine that a command made, archive every session on the machine:

1687* **Sessions on the old host**: they stay on it, and Desktop doesn't connect to that host unless you add it back. To continue one, open the session and select **Add SSH connection**. Desktop fills in the old host. Save it as a connection of its own.1701 

17021. Find the machine's sessions in the sidebar. A session's [details panel](#see-session-details) shows the host that it runs on.

17032. [Archive each session](#archive-a-session), and leave it archived.

17043. If you haven't created another machine from the same `sshHostCommands` entry since you made this one, [create one](#create-another-machine) or [remove the entry](#remove-an-entry) too. Until then, the machine is the entry's saved connection, and Desktop can connect to it when you open the new-session page with that connection selected.

17054. Delete any other SSH connection to the machine in the app, or remove its [`sshConfigs`](#pre-configure-ssh-connections-for-your-team) entry.

17065. Quit and reopen Desktop, which closes its connection to the machine and ends its attempts to reach it.

17076. Delete the machine with your tool.

1708 

1709##### Remove an entry

1710 

1711After you remove an entry from the settings file or change its `id`, the sessions on its machines stay, so Desktop can still connect to those machines. It can do so with nobody at the computer, for example to rejoin a session's running process or to deliver a message that was waiting to be sent. To stop that, archive the sessions, as [Stop using a machine](#stop-using-a-machine) describes.

1712 

1713If you're an administrator and removed a managed entry, your users' sessions stay too, and each user has to archive their own. To block the entry's machines yourself, set an [`sshHostAllowlist`](#restrict-which-ssh-hosts-users-can-connect-to) that matches the hosts your users still need and not the machines' hostnames. You can do that only where a pattern tells the two apart.

1688 1714 

1689##### Distribute commands to your team1715##### Distribute commands to your team

1690 1716 


1711* **The `id`**: if a user's `sshHostCommands` entry has your `id`, only yours works. If any other SSH connection has it, such as one in a user's `sshConfigs`, your entry is gray. Pick an `id` that users are unlikely to choose.1737* **The `id`**: if a user's `sshHostCommands` entry has your `id`, only yours works. If any other SSH connection has it, such as one in a user's `sshConfigs`, your entry is gray. Pick an `id` that users are unlikely to choose.

1712* **The program**: give its full path, because Desktop looks up a bare name on each user's own `PATH`. The program runs as the user, with the variables that their login shell exports.1738* **The program**: give its full path, because Desktop looks up a bare name on each user's own `PATH`. The program runs as the user, with the variables that their login shell exports.

1713* **Users' own entries**: Desktop treats a user's entry like a [hook](https://code.claude.com/docs/en/hooks.md), because both run a program on the computer. To allow only your entries, set [`strictPluginOnlyCustomization`](https://code.claude.com/docs/en/settings-reference#strictpluginonlycustomization) to `["hooks"]`, or add `"hooks"` to its list. You also stop Claude Code hooks from user, project, and local settings, with no way to keep them. If you set that key or [`allowManagedHooksOnly`](https://code.claude.com/docs/en/settings-reference#allowmanagedhooksonly) to `true` instead, you block more, as each key's entry lists.1739* **Users' own entries**: Desktop treats a user's entry like a [hook](https://code.claude.com/docs/en/hooks.md), because both run a program on the computer. To allow only your entries, set [`strictPluginOnlyCustomization`](https://code.claude.com/docs/en/settings-reference#strictpluginonlycustomization) to `["hooks"]`, or add `"hooks"` to its list. You also stop Claude Code hooks from user, project, and local settings, with no way to keep them. If you set that key or [`allowManagedHooksOnly`](https://code.claude.com/docs/en/settings-reference#allowmanagedhooksonly) to `true` instead, you block more, as each key's entry lists.

1714* **Every entry**: to turn off your entries too, set [`disableAllHooks`](https://code.claude.com/docs/en/settings-reference#disableallhooks) in managed settings. If you set [`disableDesktopLocalSessions`](https://code.claude.com/docs/en/settings-reference#disabledesktoplocalsessions), or an `sshHostAllowlist` that allows no host, the selector lists no **Create** or **Replace** items.1740* **Every entry**: to turn off your entries too, set [`disableAllHooks`](https://code.claude.com/docs/en/settings-reference#disableallhooks) in managed settings. If you set [`disableDesktopLocalSessions`](https://code.claude.com/docs/en/settings-reference#disabledesktoplocalsessions), or an `sshHostAllowlist` that allows no host, the selector lists no **Create** or **Create another** items.

1715* **Where the locks count**: for these entries, Desktop reads `allowManagedHooksOnly`, `strictPluginOnlyCustomization`, and `disableAllHooks` from server-managed settings and from the computer's own file or policy, and applies the stricter result. Every entry stays gray until Desktop has checked claude.ai for server-managed settings, even if your organization has none.1741* **Where the locks count**: for these entries, Desktop reads `allowManagedHooksOnly`, `strictPluginOnlyCustomization`, and `disableAllHooks` from server-managed settings and from the computer's own file or policy, and applies the stricter result. Every entry stays gray until Desktop has checked claude.ai for server-managed settings, even if your organization has none.

1716* **Allowed hosts**: if you set [`sshHostAllowlist`](#restrict-which-ssh-hosts-users-can-connect-to), make sure that a pattern matches each hostname that your tool prints, and leave `user@` out of the pattern. Desktop checks the printed name only after the command has run, so a machine that the list refuses already exists, and the user has to delete it with your tool. At each connection, the resolved `HostName` has to match too.1742* **Allowed hosts**: if you set [`sshHostAllowlist`](#restrict-which-ssh-hosts-users-can-connect-to), make sure that a pattern matches each hostname that your tool prints, and leave `user@` out of the pattern. Desktop checks the printed name only after the command has run, so a machine that the list refuses already exists, and the user has to delete it with your tool. At each connection, the resolved `HostName` has to match too.

1717 1743 


1719 1745 

1720##### If a command is missing or gray1746##### If a command is missing or gray

1721 1747 

1722The environment selector lists no **Create** or **Replace** item in these cases:1748The environment selector lists no **Create** or **Create another** item in these cases:

1723 1749 

1724* **The file**: `~/.claude/settings.json` has [invalid JSON or a value that the schema rejects](https://code.claude.com/docs/en/settings.md#fix-a-broken-settings-file), you misspelled the key, or you put it in a project's settings. Fix the file.1750* **The file**: `~/.claude/settings.json` has [invalid JSON or a value that the schema rejects](https://code.claude.com/docs/en/settings.md#fix-a-broken-settings-file), you misspelled the key, or you put it in a project's settings. Fix the file.

1725* **Platform and account**: you use Windows, or a [third-party provider](https://code.claude.com/docs/en/third-party-integrations.md) instead of a Claude account. Add each host as an [SSH connection](#ssh-sessions) yourself.1751* **Platform and account**: you use Windows, or a [third-party provider](https://code.claude.com/docs/en/third-party-integrations.md) instead of a Claude account. Add each host as an [SSH connection](#ssh-sessions) yourself.


1730 1756 

1731* **A mistake in the entry**: fix the field or the command that the message names. If the `id` is in use, give the entry another one.1757* **A mistake in the entry**: fix the field or the command that the message names. If the `id` is in use, give the entry another one.

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

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

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

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

1736 1762 


1946 1972 

1947Replace the placeholder with your claude.ai organization ID, shown in [claude.ai admin settings](https://claude.ai/admin-settings/organization). It's the same ID that Claude Code's [`forceLoginOrgUUID`](https://code.claude.com/docs/en/settings-reference#forceloginorguuid) setting takes. For macOS and Windows samples that set this key, see [Deploy the Claude Desktop policy](https://claude.com/docs/cowork/hipaa-setup#deploy-the-claude-desktop-policy) in the Cowork guide for HIPAA-ready organizations.1973Replace the placeholder with your claude.ai organization ID, shown in [claude.ai admin settings](https://claude.ai/admin-settings/organization). It's the same ID that Claude Code's [`forceLoginOrgUUID`](https://code.claude.com/docs/en/settings-reference#forceloginorguuid) setting takes. For macOS and Windows samples that set this key, see [Deploy the Claude Desktop policy](https://claude.com/docs/cowork/hipaa-setup#deploy-the-claude-desktop-policy) in the Cowork guide for HIPAA-ready organizations.

1948 1974 

1975> [!WARNING]

1976>

1977> Check the `forceLoginOrgUUID` value before you deploy it. If the ID isn't your organization's, people in your organization can't use Claude Desktop unless they also belong to an organization with that ID. To recover, deploy the correct ID and have them restart Claude Desktop.

1978 

1949If you set `forceLoginMethod` and `forceLoginOrgUUID` in Claude Code's [managed settings](https://code.claude.com/docs/en/managed-settings.md), you don't change the Claude Desktop sign-in screen.1979If you set `forceLoginMethod` and `forceLoginOrgUUID` in Claude Code's [managed settings](https://code.claude.com/docs/en/managed-settings.md), you don't change the Claude Desktop sign-in screen.

1950 1980 

1951### Network access requirements1981### Network access requirements


2055| `--model sonnet` | Model picker in the row under the prompt box |2085| `--model sonnet` | Model picker in the row under the prompt box |

2056| `--resume`, `--continue` | Click a session in the sidebar, or type `/resume` in the prompt box to pick up a session you started from the CLI |2086| `--resume`, `--continue` | Click a session in the sidebar, or type `/resume` in the prompt box to pick up a session you started from the CLI |

2057| `--permission-mode` | Mode selector in the row under the prompt box |2087| `--permission-mode` | Mode selector in the row under the prompt box |

2058| `--dangerously-skip-permissions` | Bypass permissions mode. On Pro and Max plans, enable "Allow bypass permissions mode" in **Settings > Code** or **Settings > Claude Code**; on Team and Enterprise plans, organization policy controls it |2088| `--dangerously-skip-permissions` | Bypass permissions mode. On Pro, Max, and Ultra plans, enable "Allow bypass permissions mode" in **Settings > Code** or **Settings > Claude Code**; on Team and Enterprise plans, organization policy controls it |

2059| `--add-dir` | [Add folders to a session](#add-folders-to-a-session) in local and SSH sessions, or select [several repositories](#run-long-running-tasks-in-the-cloud) in a cloud session |2089| `--add-dir` | [Add folders to a session](#add-folders-to-a-session) in local and SSH sessions, or select [several repositories](#run-long-running-tasks-in-the-cloud) in a cloud session |

2060| `--allowedTools`, `--disallowedTools` | No per-session equivalent. Permission rules in [settings files](https://code.claude.com/docs/en/settings.md) still apply. |2090| `--allowedTools`, `--disallowedTools` | No per-session equivalent. Permission rules in [settings files](https://code.claude.com/docs/en/settings.md) still apply. |

2061| `--verbose` | [Verbose view mode](#switch-view-modes) |2091| `--verbose` | [Verbose view mode](#switch-view-modes) |


2091 2121 

2092| Feature | CLI | Desktop |2122| Feature | CLI | Desktop |

2093| - | - | - |2123| - | - | - |

2094| Permission modes | All modes including `dontAsk` | Manual, Accept edits, Plan, and Auto. Bypass permissions appears in the mode selector once enabled: through the Settings toggle on Pro and Max plans, or through organization policy on Team and Enterprise plans |2124| Permission modes | All modes including `dontAsk` | Manual, Accept edits, Plan, and Auto. Bypass permissions appears in the mode selector once enabled: through the Settings toggle on Pro, Max, and Ultra plans, or through organization policy on Team and Enterprise plans |

2095| [Third-party providers](https://code.claude.com/docs/en/third-party-integrations.md) | Amazon Bedrock, Google Cloud's Agent Platform, Microsoft Foundry | Anthropic's API by default. For gateway routing, see [connect the desktop app to a gateway](https://code.claude.com/docs/en/llm-gateway-connect.md#desktop-app). To run the Code tab on Amazon Bedrock, Google Cloud's Agent Platform, Microsoft Foundry, or a self-hosted LLM gateway, see [Claude Desktop on 3P](https://claude.com/docs/third-party/claude-desktop/overview). |2125| [Third-party providers](https://code.claude.com/docs/en/third-party-integrations.md) | Amazon Bedrock, Google Cloud's Agent Platform, Microsoft Foundry | Anthropic's API by default. For gateway routing, see [connect the desktop app to a gateway](https://code.claude.com/docs/en/llm-gateway-connect.md#desktop-app). To run the Code tab on Amazon Bedrock, Google Cloud's Agent Platform, Microsoft Foundry, or a self-hosted LLM gateway, see [Claude Desktop on 3P](https://claude.com/docs/third-party/claude-desktop/overview). |

2096| [MCP servers](https://code.claude.com/docs/en/mcp.md) | Configure in settings files | Connectors UI for local and SSH sessions, or settings files |2126| [MCP servers](https://code.claude.com/docs/en/mcp.md) | Configure in settings files | Connectors UI for local and SSH sessions, or settings files |

2097| [Plugins](https://code.claude.com/docs/en/plugins/overview.md) | `/plugin` command | Plugin manager UI |2127| [Plugins](https://code.claude.com/docs/en/plugins/overview.md) | `/plugin` command | Plugin manager UI |


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

2154 2184 

21551. Sign out and back in from the app menu. This is the most common fix.21851. Sign out and back in from the app menu. This is the most common fix.

21562. Verify you have an active paid subscription: Pro, Max, Team, or Enterprise.21862. Verify you have an active paid subscription: Pro, Max, Ultra, Team, or Enterprise.

21573. If the CLI works but Desktop does not, quit the desktop app completely, not just close the window, then reopen and sign in again.21873. If the CLI works but Desktop does not, quit the desktop app completely, not just close the window, then reopen and sign in again.

21584. Check your internet connection and proxy settings.21884. Check your internet connection and proxy settings.

2159 2189 

Details

8 8 

9> [!NOTE]9> [!NOTE]

10>10>

11> The iOS Simulator pane is in public beta in Claude Code Desktop on macOS. It's available on Pro, Max, Team, and Enterprise plans, except in Enterprise organizations that have a HIPAA configuration enabled.11> The iOS Simulator pane is in public beta in Claude Code Desktop on macOS. It's available on Pro, Max, Ultra, Team, and Enterprise plans, except in Enterprise organizations that have a HIPAA configuration enabled.

12 12 

13The iOS Simulator pane shows your app running in Apple's iOS Simulator next to your conversation in Claude Code Desktop. When Claude builds, installs, launches, or checks your app in a simulator, the pane opens automatically and streams the device screen live. Use it to watch Claude run and test your app, or to tap through the app yourself while Claude keeps working.13The iOS Simulator pane shows your app running in Apple's iOS Simulator next to your conversation in Claude Code Desktop. When Claude builds, installs, launches, or checks your app in a simulator, the pane opens automatically and streams the device screen live. Use it to watch Claude run and test your app, or to tap through the app yourself while Claude keeps working.

14 14 

Details

6 6 

7> Install the Claude desktop app, open the Code tab, and start your first Claude Code session on a project folder on your computer.7> Install the Claude desktop app, open the Code tab, and start your first Claude Code session on a project folder on your computer.

8 8 

9The desktop app gives you Claude Code with a graphical interface. You can ask Claude to work on the code in a folder on your computer and review its changes without using a terminal.9The desktop app gives you Claude Code with a graphical interface. You can ask Claude to work on the code in a folder on your computer, then review the changes yourself, without using a terminal.

10 10 

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

12 12 

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

14>14>

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

16 16 

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

18>18>

19> For x64 processors19> For x64 processors

20 20 

21> **[Get Claude for Linux (beta)](https://code.claude.com/docs/en/desktop-linux.md)**21> [card] [Get Claude for Linux (beta)](https://code.claude.com/docs/en/desktop-linux.md)

22>22>

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

24 24 

devcontainer.md +1 −1

Details

17> Only use dev containers when developing with trusted repositories, and monitor Claude's activities.17> Only use dev containers when developing with trusted repositories, and monitor Claude's activities.

18> Avoid mounting host secrets such as `~/.ssh` or cloud credential files into the container; prefer repository-scoped or short-lived tokens.18> Avoid mounting host secrets such as `~/.ssh` or cloud credential files into the container; prefer repository-scoped or short-lived tokens.

19 19 

20> **How dev containers work with your editor**20> [accordion] How dev containers work with your editor

21>21>

22> ![Diagram showing an editor on the host connecting to a Docker dev container. Claude Code, the terminal, and build tools run inside the container. The host repository is bind-mounted into the container as the workspace.](https://mintcdn.com/claude-code/YvJyjZfd9yMihr0i/images/devcontainer-architecture.svg?fit=max\&auto=format\&n=YvJyjZfd9yMihr0i\&q=85\&s=9017b1d16a446c6cc37ba562f35b9aae)22> ![Diagram showing an editor on the host connecting to a Docker dev container. Claude Code, the terminal, and build tools run inside the container. The host repository is bind-mounted into the container as the workspace.](https://mintcdn.com/claude-code/YvJyjZfd9yMihr0i/images/devcontainer-architecture.svg?fit=max\&auto=format\&n=YvJyjZfd9yMihr0i\&q=85\&s=9017b1d16a446c6cc37ba562f35b9aae)

23>23>

env-vars.md +41 −41

Details

23 23 

24Set the variable before launching `claude`:24Set the variable before launching `claude`:

25 25 

26**macOS, Linux, WSL**26> [tab] macOS, Linux, WSL

27 27>

28```bash theme={null}28> ```bash theme={null}

29export API_TIMEOUT_MS="1200000"29> export API_TIMEOUT_MS="1200000"

30claude30> claude

31```31> ```

32 32>

33To set it for every session, add the `export` line to `~/.bashrc`, `~/.zshrc`, or your shell's profile file.33> To set it for every session, add the `export` line to `~/.bashrc`, `~/.zshrc`, or your shell's profile file.

34 

35**Windows PowerShell**

36 

37```powershell theme={null}

38$env:API_TIMEOUT_MS = "1200000"

39claude

40```

41 

42To set it for every session, run `[Environment]::SetEnvironmentVariable("API_TIMEOUT_MS", "1200000", "User")` and open a new terminal.

43 

44**Windows CMD**

45 34 

46```batch theme={null}35> [tab] Windows PowerShell

47set API_TIMEOUT_MS=120000036>

48claude37> ```powershell theme={null}

49```38> $env:API_TIMEOUT_MS = "1200000"

39> claude

40> ```

41>

42> To set it for every session, run `[Environment]::SetEnvironmentVariable("API_TIMEOUT_MS", "1200000", "User")` and open a new terminal.

50 43 

51To set it for every session, run `setx API_TIMEOUT_MS "1200000"` and open a new terminal.44> [tab] Windows CMD

45>

46> ```batch theme={null}

47> set API_TIMEOUT_MS=1200000

48> claude

49> ```

50>

51> To set it for every session, run `setx API_TIMEOUT_MS "1200000"` and open a new terminal.

52 52 

53The assignment line prints nothing on success. To confirm the variable is set, print it in the same shell:53The assignment line prints nothing on success. To confirm the variable is set, print it in the same shell:

54 54 

55**macOS, Linux, WSL**55> [tab] macOS, Linux, WSL

56 56>

57```bash theme={null}57> ```bash theme={null}

58echo $API_TIMEOUT_MS58> echo $API_TIMEOUT_MS

59```59> ```

60 

61**Windows PowerShell**

62 

63```powershell theme={null}

64echo $env:API_TIMEOUT_MS

65```

66 60 

67**Windows CMD**61> [tab] Windows PowerShell

62>

63> ```powershell theme={null}

64> echo $env:API_TIMEOUT_MS

65> ```

68 66 

69```batch theme={null}67> [tab] Windows CMD

70echo %API_TIMEOUT_MS%68>

71```69> ```batch theme={null}

70> echo %API_TIMEOUT_MS%

71> ```

72 72 

73### Set variables in settings files73### Set variables in settings files

74 74 


130 130 

131| Variable | Purpose |131| Variable | Purpose |

132| :- | :- |132| :- | :- |

133| `ANTHROPIC_API_KEY` | API key sent as `X-Api-Key` header. When set, this key is used instead of your Claude Pro, Max, Team, or Enterprise subscription even if you are logged in. In non-interactive mode (`-p`), the key is always used when present. In interactive mode, you are prompted to approve the key once before it overrides your subscription. To use your subscription instead, run `unset ANTHROPIC_API_KEY` |133| `ANTHROPIC_API_KEY` | API key sent as `X-Api-Key` header. When set, this key is used instead of your Claude Pro, Max, Ultra, Team, or Enterprise subscription even if you are logged in. In non-interactive mode (`-p`), the key is always used when present. In interactive mode, you are prompted to approve the key once before it overrides your subscription. To use your subscription instead, run `unset ANTHROPIC_API_KEY` |

134| `ANTHROPIC_AUTH_TOKEN` | Custom value for the `Authorization` header (the value you set here will be prefixed with `Bearer `) |134| `ANTHROPIC_AUTH_TOKEN` | Custom value for the `Authorization` header (the value you set here will be prefixed with `Bearer `) |

135| `ANTHROPIC_AWS_API_KEY` | Workspace API key for [Claude Platform on AWS](https://code.claude.com/docs/en/claude-platform-on-aws.md), generated in the AWS Console. Sent as `x-api-key` and takes precedence over AWS SigV4 |135| `ANTHROPIC_AWS_API_KEY` | Workspace API key for [Claude Platform on AWS](https://code.claude.com/docs/en/claude-platform-on-aws.md), generated in the AWS Console. Sent as `x-api-key` and takes precedence over AWS SigV4 |

136| `ANTHROPIC_AWS_BASE_URL` | Override the [Claude Platform on AWS](https://code.claude.com/docs/en/claude-platform-on-aws.md) endpoint URL. Use for custom regions or when routing through an [LLM gateway](https://code.claude.com/docs/en/llm-gateway). Defaults to `https://aws-external-anthropic.{region}.api.aws`. Claude Code resolves the region with the [same precedence as on Amazon Bedrock](https://code.claude.com/docs/en/amazon-bedrock.md#3-configure-claude-code) |136| `ANTHROPIC_AWS_BASE_URL` | Override the [Claude Platform on AWS](https://code.claude.com/docs/en/claude-platform-on-aws.md) endpoint URL. Use for custom regions or when routing through an [LLM gateway](https://code.claude.com/docs/en/llm-gateway). Defaults to `https://aws-external-anthropic.{region}.api.aws`. Claude Code resolves the region with the [same precedence as on Amazon Bedrock](https://code.claude.com/docs/en/amazon-bedrock.md#3-configure-claude-code) |


575* [Message sessions beyond this machine](https://code.claude.com/docs/en/cross-session-messaging.md#message-sessions-on-other-machines) when [Remote Control](https://code.claude.com/docs/en/remote-control.md#requirements) is unavailable. Messaging between sessions on this machine works with fetching off575* [Message sessions beyond this machine](https://code.claude.com/docs/en/cross-session-messaging.md#message-sessions-on-other-machines) when [Remote Control](https://code.claude.com/docs/en/remote-control.md#requirements) is unavailable. Messaging between sessions on this machine works with fetching off

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

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

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

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

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

581* Use [the advisor tool](https://code.claude.com/docs/en/advisor.md#requirements)581* Use [the advisor tool](https://code.claude.com/docs/en/advisor.md#requirements)

errors.md +5 −5

Details

830* In the Code tab of the [Desktop app](https://code.claude.com/docs/en/desktop.md), the session-limit card offers an **Auto-continue when limits reset** checkbox. The weekly-limit card doesn't. When it's checked, the Desktop app retries the interrupted turn after the reset and shows the retry time on the card. The Desktop checkbox and the CLI's **Continue automatically at usage limit** setting in `/config` are separate, so turn each off on its own.830* In the Code tab of the [Desktop app](https://code.claude.com/docs/en/desktop.md), the session-limit card offers an **Auto-continue when limits reset** checkbox. The weekly-limit card doesn't. When it's checked, the Desktop app retries the interrupted turn after the reset and shows the retry time on the card. The Desktop checkbox and the CLI's **Continue automatically at usage limit** setting in `/config` are separate, so turn each off on its own.

831* For the Opus or Sonnet limit, run `/model` and switch to a model outside that family to keep working. Each model has its own prompt cache, so the next request re-reads the whole conversation with no cache hits; see [Switching models](https://code.claude.com/docs/en/prompt-caching.md#switching-models)831* For the Opus or Sonnet limit, run `/model` and switch to a model outside that family to keep working. Each model has its own prompt cache, so the next request re-reads the whole conversation with no cache hits; see [Switching models](https://code.claude.com/docs/en/prompt-caching.md#switching-models)

832* Run `/usage` to see your plan limits and when they reset832* Run `/usage` to see your plan limits and when they reset

833* Run `/usage-credits` to buy additional usage on Pro and Max, or to request it from your admin on Team and Enterprise. See [usage credits for paid plans](https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans) for how this is billed.833* Run `/usage-credits` to buy additional usage on Pro, Max, and Ultra, or to request it from your admin on Team and Enterprise. See [usage credits for paid plans](https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans) for how this is billed.

834* To upgrade your plan for higher base limits, see [claude.com/pricing](https://claude.com/pricing)834* To upgrade your plan for higher base limits, see [claude.com/pricing](https://claude.com/pricing)

835 835 

836Before a window runs out, Claude Code can warn you that you've used most of it, with a message such as `You've used 85% of your session limit · resets 3:45pm`. To watch your remaining allowance continuously, add the `rate_limits` fields to a [custom status line](https://code.claude.com/docs/en/statusline.md#rate-limit-usage), or in the Desktop app click the [usage ring](https://code.claude.com/docs/en/desktop.md#check-usage) next to the model picker.836Before a window runs out, Claude Code can warn you that you've used most of it, with a message such as `You've used 85% of your session limit · resets 3:45pm`. To watch your remaining allowance continuously, add the `rate_limits` fields to a [custom status line](https://code.claude.com/docs/en/statusline.md#rate-limit-usage), or in the Desktop app click the [usage ring](https://code.claude.com/docs/en/desktop.md#check-usage) next to the model picker.


852**What to do:**852**What to do:**

853 853 

854* Run `/model` and select the variant without the `[1m]` suffix to fall back to the standard context window854* Run `/model` and select the variant without the `[1m]` suffix to fall back to the standard context window

855* Where the message names `/usage-credits`, run it to turn on metered billing for the 1M variant on Pro and Max, or to request usage credits from your admin on Team and Enterprise. Once usage credits are on, restart Claude Code or start a new session, whichever the message says. Until then, the session stays at the standard context limit.855* Where the message names `/usage-credits`, run it to turn on metered billing for the 1M variant on Pro, Max, and Ultra, or to request usage credits from your admin on Team and Enterprise. Once usage credits are on, restart Claude Code or start a new session, whichever the message says. Until then, the session stays at the standard context limit.

856* If the error persists after `/model`, a 1M model ID may be set elsewhere. See [Setting your model](https://code.claude.com/docs/en/model-config.md#setting-your-model) for the configuration locations to check in priority order.856* If the error persists after `/model`, a 1M model ID may be set elsewhere. See [Setting your model](https://code.claude.com/docs/en/model-config.md#setting-your-model) for the configuration locations to check in priority order.

857* To remove 1M variants from the model picker entirely, set [`CLAUDE_CODE_DISABLE_1M_CONTEXT=1`](https://code.claude.com/docs/en/env-vars)857* To remove 1M variants from the model picker entirely, set [`CLAUDE_CODE_DISABLE_1M_CONTEXT=1`](https://code.claude.com/docs/en/env-vars)

858 858 


933 933 

934**What to do:**934**What to do:**

935 935 

936* On Pro and Max, increase your monthly spend limit in [**Settings > Usage**](https://claude.ai/settings/usage) on claude.ai, or run `/usage-credits`936* On Pro, Max, and Ultra, increase your monthly spend limit in [**Settings > Usage**](https://claude.ai/settings/usage) on claude.ai, or run `/usage-credits`

937* On Team and Enterprise, increase the limit in [**Organization settings > Usage**](https://claude.ai/admin-settings/usage) if you manage billing, or ask an admin to. `/usage-credits` sends that request to your admin for you937* On Team and Enterprise, increase the limit in [**Organization settings > Usage**](https://claude.ai/admin-settings/usage) if you manage billing, or ask an admin to. `/usage-credits` sends that request to your admin for you

938* For a channel's limit, ask an org owner or the channel's manager to raise it on claude.ai. See [Per-channel limits](https://claude.com/docs/claude-tag/admins/set-spend-limit#per-channel-limits) in the Claude Tag documentation938* For a channel's limit, ask an org owner or the channel's manager to raise it on claude.ai. See [Per-channel limits](https://claude.com/docs/claude-tag/admins/set-spend-limit#per-channel-limits) in the Claude Tag documentation

939* If the message names a reset time for your plan's window, you can wait for it instead939* If the message names a reset time for your plan's window, you can wait for it instead


966 966 

967**What to do:**967**What to do:**

968 968 

969* If you have a Pro, Max, Team, or Enterprise plan and see this, run `/status` and check the `API key` row. An approved `ANTHROPIC_API_KEY` in your environment routes requests through that key instead of your subscription. Unset it in the current shell and remove it from your shell profile, then relaunch `claude`. Run `/login` if you haven't signed in with your subscription yet.969* If you have a Pro, Max, Ultra, Team, or Enterprise plan and see this, run `/status` and check the `API key` row. An approved `ANTHROPIC_API_KEY` in your environment routes requests through that key instead of your subscription. Unset it in the current shell and remove it from your shell profile, then relaunch `claude`. Run `/login` if you haven't signed in with your subscription yet.

970* Add credits at [platform.claude.com/settings/billing](https://platform.claude.com/settings/billing), and consider enabling auto-reload there so the balance refills before it hits zero970* Add credits at [platform.claude.com/settings/billing](https://platform.claude.com/settings/billing), and consider enabling auto-reload there so the balance refills before it hits zero

971* Set per-workspace spend caps in the Console to prevent a single project from draining the org balance. See [Manage costs effectively](https://code.claude.com/docs/en/costs.md).971* Set per-workspace spend caps in the Console to prevent a single project from draining the org balance. See [Manage costs effectively](https://code.claude.com/docs/en/costs.md).

972 972 


1120 1120 

1121The hint after the `·` depends on your saved credentials: the first form appears when a stored `/login` can take over after you unset the key, and the second when the key is your only credential.1121The hint after the `·` depends on your saved credentials: the first form appears when a stored `/login` can take over after you unset the key, and the second when the key is your only credential.

1122 1122 

1123Environment variables take precedence over `/login`, so a key exported in your shell profile or loaded from a `.env` file is used even when you have a working Pro or Max subscription. In non-interactive mode (`-p`), the key is always used when present.1123If you export a key in your shell profile or load one from `.env`, Claude Code uses it instead of `/login`, even with a working Pro, Max, or Ultra subscription. In non-interactive mode (`-p`), the key is always used when present.

1124 1124 

1125**What to do:**1125**What to do:**

1126 1126 

fast-mode.md +5 −5

Details

20 20 

21* Use `/fast` to toggle on fast mode in the Claude Code CLI. The [VS Code extension](https://code.claude.com/docs/en/vs-code.md) offers a **Toggle fast mode** command when the selected model supports fast mode. Claude Code saves that toggle to your [`fastMode` setting](#toggle-fast-mode).21* Use `/fast` to toggle on fast mode in the Claude Code CLI. The [VS Code extension](https://code.claude.com/docs/en/vs-code.md) offers a **Toggle fast mode** command when the selected model supports fast mode. Claude Code saves that toggle to your [`fastMode` setting](#toggle-fast-mode).

22* Fast mode pricing per MTok input/output is \$8/\$40 on Opus 5.5 and \$10/\$50 on Opus 5 and Opus 4.8.22* Fast mode pricing per MTok input/output is \$8/\$40 on Opus 5.5 and \$10/\$50 on Opus 5 and Opus 4.8.

23* Available to Claude Code users on subscription plans (Pro/Max/Team/Enterprise) and on Claude Console. Team and Enterprise organizations need an Owner to enable it first, and Console organizations need access provisioned first to use it with Opus 5 or Opus 4.8. [Requirements](#requirements) describes both.23* Available to Claude Code users on subscription plans (Pro/Max/Ultra/Team/Enterprise) and on Claude Console. Team and Enterprise organizations need an Owner to enable it first, and Console organizations need access provisioned first to use it with Opus 5 or Opus 4.8. [Requirements](#requirements) describes both.

24* For Claude Code users on subscription plans (Pro/Max/Team/Enterprise), fast mode is available via usage credits only and not included in the subscription rate limits.24* For Claude Code users on subscription plans (Pro/Max/Ultra/Team/Enterprise), fast mode is available via usage credits only and not included in the subscription rate limits.

25 25 

26## Toggle fast mode26## Toggle fast mode

27 27 


86 86 

87You see fast mode spend in a different place depending on how you signed in, so first run [`/status`](https://code.claude.com/docs/en/commands) to check. If it shows a `Login method` row such as `Claude Max account`, you signed in with a Claude subscription. If it shows an `API key` row instead, your requests bill to a Claude Console organization.87You see fast mode spend in a different place depending on how you signed in, so first run [`/status`](https://code.claude.com/docs/en/commands) to check. If it shows a `Login method` row such as `Claude Max account`, you signed in with a Claude subscription. If it shows an `API key` row instead, your requests bill to a Claude Console organization.

88 88 

89* **Pro and Max**: you pay for fast mode from your usage credits. Go to [**Settings > Usage**](https://claude.ai/settings/usage) on claude.ai, where the **Usage credits** section shows how much you've spent in usage credits this month. That figure includes fast mode but doesn't break it out separately.89* **Pro, Max, and Ultra**: you pay for fast mode from your usage credits. Go to [**Settings > Usage**](https://claude.ai/settings/usage) on claude.ai, where the **Usage credits** section shows how much you've spent in usage credits this month. That figure includes fast mode but doesn't break it out separately.

90* **Team and Enterprise**: your organization pays for your fast mode usage from its usage credits. To see your own usage-credits spend, run [`/usage`](https://code.claude.com/docs/en/costs#check-your-usage-credits-spend). For where your organization sees that spend, see [Claude for Teams and Enterprise](https://code.claude.com/docs/en/costs.md#claude-for-teams-and-enterprise).90* **Team and Enterprise**: your organization pays for your fast mode usage from its usage credits. To see your own usage-credits spend, run [`/usage`](https://code.claude.com/docs/en/costs#check-your-usage-credits-spend). For where your organization sees that spend, see [Claude for Teams and Enterprise](https://code.claude.com/docs/en/costs.md#claude-for-teams-and-enterprise).

91* **Claude Console**: your organization pays for fast mode with the rest of its API usage. On the Console [Usage](https://platform.claude.com/usage) and [Cost](https://platform.claude.com/cost) pages, select **Speed (Research Preview)** in the **Group by** menu to separate fast mode from standard-speed usage. You see that option only when the selected date range includes fast mode usage.91* **Claude Console**: your organization pays for fast mode with the rest of its API usage. On the Console [Usage](https://platform.claude.com/usage) and [Cost](https://platform.claude.com/cost) pages, select **Speed (Research Preview)** in the **Group by** menu to separate fast mode from standard-speed usage. You see that option only when the selected date range includes fast mode usage.

92 92 


120Fast mode requires all of the following:120Fast mode requires all of the following:

121 121 

122* **Anthropic API or subscription only**: fast mode is available through the Anthropic Console API and for Claude subscription plans using usage credits. It is not available on Amazon Bedrock, Google Cloud's Agent Platform, Microsoft Foundry, or Claude Platform on AWS. Console organizations must also have [fast mode access provisioned](#enable-fast-mode-for-your-organization) to use it with Opus 5 or Opus 4.8.122* **Anthropic API or subscription only**: fast mode is available through the Anthropic Console API and for Claude subscription plans using usage credits. It is not available on Amazon Bedrock, Google Cloud's Agent Platform, Microsoft Foundry, or Claude Platform on AWS. Console organizations must also have [fast mode access provisioned](#enable-fast-mode-for-your-organization) to use it with Opus 5 or Opus 4.8.

123* **Usage credits turned on for subscription plans**: on a Pro, Max, Team, or Enterprise plan, your account must have [usage credits](https://code.claude.com/docs/en/costs.md#add-usage-credits-to-your-subscription) turned on, which allows billing beyond your plan's included usage. Until they're on, `/fast` reports "Fast mode requires usage credits". How you turn them on depends on your plan:123* **Usage credits turned on for subscription plans**: on a Pro, Max, Ultra, Team, or Enterprise plan, your account must have [usage credits](https://code.claude.com/docs/en/costs.md#add-usage-credits-to-your-subscription) turned on, which allows billing beyond your plan's included usage. Until they're on, `/fast` reports "Fast mode requires usage credits". To turn them on, follow the step for your plan:

124 * On Pro and Max, turn them on in the **Usage credits** section of [**Settings > Usage**](https://claude.ai/settings/usage) on claude.ai, or run `/usage-credits` to open that page.124 * On Pro, Max, and Ultra, turn them on in the **Usage credits** section of [**Settings > Usage**](https://claude.ai/settings/usage) on claude.ai, or run `/usage-credits` to open that page.

125 * On Team and Enterprise, a member with billing access turns them on for the organization at [**Organization settings > Usage**](https://claude.ai/admin-settings/usage), and a member without it runs `/usage-credits` to send the organization's admins a request.125 * On Team and Enterprise, a member with billing access turns them on for the organization at [**Organization settings > Usage**](https://claude.ai/admin-settings/usage), and a member without it runs `/usage-credits` to send the organization's admins a request.

126 126 

127> [!NOTE]127> [!NOTE]

Details

14 14 

15How you authenticate determines which features Claude Code can reach. For a single list of what is missing on your provider, see the [summary by provider](#summary-by-provider) tabs. To find your column in the tables:15How you authenticate determines which features Claude Code can reach. For a single list of what is missing on your provider, see the [summary by provider](#summary-by-provider) tabs. To find your column in the tables:

16 16 

17* **Claude subscription**: you sign in with a claude.ai account on the Pro, Max, Team, or Enterprise plan17* **Claude subscription**: you sign in with a claude.ai account on the Pro, Max, Ultra, Team, or Enterprise plan

18* **Anthropic Console**: you authenticate with an Anthropic API key or by [signing in to a Console account without one](https://code.claude.com/docs/en/authentication.md#sign-in-without-an-api-key)18* **Anthropic Console**: you authenticate with an Anthropic API key or by [signing in to a Console account without one](https://code.claude.com/docs/en/authentication.md#sign-in-without-an-api-key)

19* **Amazon Bedrock**: you use Claude models from the Amazon Bedrock model catalog and set `CLAUDE_CODE_USE_BEDROCK`. The [Mantle endpoint](https://code.claude.com/docs/en/amazon-bedrock.md#use-the-mantle-endpoint) (`CLAUDE_CODE_USE_MANTLE`) is covered by this column19* **Amazon Bedrock**: you use Claude models from the Amazon Bedrock model catalog and set `CLAUDE_CODE_USE_BEDROCK`. The [Mantle endpoint](https://code.claude.com/docs/en/amazon-bedrock.md#use-the-mantle-endpoint) (`CLAUDE_CODE_USE_MANTLE`) is covered by this column

20* **Claude Platform on AWS**: you bought Claude through AWS Marketplace but call the Anthropic API, and set `CLAUDE_CODE_USE_ANTHROPIC_AWS`20* **Claude Platform on AWS**: you bought Claude through AWS Marketplace but call the Anthropic API, and set `CLAUDE_CODE_USE_ANTHROPIC_AWS`


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

47 47 

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

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

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

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

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

53* [Code Review](https://code.claude.com/docs/en/code-review.md): Team and Enterprise plans53* [Code Review](https://code.claude.com/docs/en/code-review.md): Team and Enterprise plans

54* [Remote Control](https://code.claude.com/docs/en/remote-control.md)54* [Remote Control](https://code.claude.com/docs/en/remote-control.md)

55* [Chrome extension](https://code.claude.com/docs/en/chrome.md)55* [Chrome extension](https://code.claude.com/docs/en/chrome.md)

56* [Computer use](https://code.claude.com/docs/en/computer-use.md): Pro and Max plans56* [Computer use](https://code.claude.com/docs/en/computer-use.md): Pro, Max, and Ultra plans

57* [Artifacts](https://code.claude.com/docs/en/artifacts.md): Pro, Max, Team, and Enterprise plans57* [Artifacts](https://code.claude.com/docs/en/artifacts.md): Pro, Max, Ultra, Team, and Enterprise plans

58* [Voice dictation](https://code.claude.com/docs/en/voice-dictation.md)58* [Voice dictation](https://code.claude.com/docs/en/voice-dictation.md)

59 59 

60Desktop is the partial exception: [gateway routing can be configured in the app or by an administrator](https://code.claude.com/docs/en/llm-gateway-connect.md#desktop-app). [Claude Desktop on 3P](https://claude.com/docs/third-party/claude-desktop/overview) also runs the Code tab on Amazon Bedrock, Google Cloud's Agent Platform, Microsoft Foundry, or a self-hosted LLM gateway. It also runs the Code tab on the [Claude API](https://claude.com/docs/third-party/claude-desktop/claude-api) with an Anthropic Console API key. For per-plan availability of these features, see [Availability by subscription plan](#availability-by-subscription-plan).60Desktop is the partial exception: [gateway routing can be configured in the app or by an administrator](https://code.claude.com/docs/en/llm-gateway-connect.md#desktop-app). [Claude Desktop on 3P](https://claude.com/docs/third-party/claude-desktop/overview) also runs the Code tab on Amazon Bedrock, Google Cloud's Agent Platform, Microsoft Foundry, or a self-hosted LLM gateway. It also runs the Code tab on the [Claude API](https://claude.com/docs/third-party/claude-desktop/claude-api) with an Anthropic Console API key. For per-plan availability of these features, see [Availability by subscription plan](#availability-by-subscription-plan).


229 229 

230Each tab lists what is unavailable or partially supported on that provider, with alternatives where one exists. Everything not listed works the same as on a Claude subscription, apart from the [provider-specific differences](#features-available-on-every-provider) noted above. On Amazon Bedrock, Google Cloud's Agent Platform, Microsoft Foundry, and Claude Platform on AWS, error reporting and telemetry to Anthropic are off by default. See [default behaviors by API provider](https://code.claude.com/docs/en/data-usage.md#default-behaviors-by-api-provider) for what traffic still reaches Anthropic and how to opt out.230Each tab lists what is unavailable or partially supported on that provider, with alternatives where one exists. Everything not listed works the same as on a Claude subscription, apart from the [provider-specific differences](#features-available-on-every-provider) noted above. On Amazon Bedrock, Google Cloud's Agent Platform, Microsoft Foundry, and Claude Platform on AWS, error reporting and telemetry to Anthropic are off by default. See [default behaviors by API provider](https://code.claude.com/docs/en/data-usage.md#default-behaviors-by-api-provider) for what traffic still reaches Anthropic and how to opt out.

231 231 

232**Amazon Bedrock**232> [tab] Amazon Bedrock

233 233>

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

235 235>

236**Partial support:**236> **Partial support:**

237 237>

238* [Desktop](https://code.claude.com/docs/en/desktop.md): only via [Claude Desktop on 3P](https://claude.com/docs/third-party/claude-desktop/overview)238> * [Desktop](https://code.claude.com/docs/en/desktop.md): only via [Claude Desktop on 3P](https://claude.com/docs/third-party/claude-desktop/overview)

239* [Auto mode](https://code.claude.com/docs/en/auto-mode-config.md): Sonnet 5 or later, Opus 4.7 or later, Haiku 5.5, and Fable models only239> * [Auto mode](https://code.claude.com/docs/en/auto-mode-config.md): Sonnet 5 or later, Opus 4.7 or later, Haiku 5.5, and Fable models only

240* [Cross-session messaging](https://code.claude.com/docs/en/cross-session-messaging.md): between your sessions on this machine only <sup>[5](#fn5)</sup>240> * [Cross-session messaging](https://code.claude.com/docs/en/cross-session-messaging.md): between your sessions on this machine only <sup>[5](#fn5)</sup>

241* [Zero Data Retention](https://code.claude.com/docs/en/zero-data-retention.md): subject to your AWS agreement241> * [Zero Data Retention](https://code.claude.com/docs/en/zero-data-retention.md): subject to your AWS agreement

242 242>

243**Alternatives:** for scheduling, use [`/loop`](https://code.claude.com/docs/en/scheduled-tasks) instead of `/schedule`. For cloud sessions, use [GitHub Actions](https://code.claude.com/docs/en/github-actions.md) or [GitLab CI/CD](https://code.claude.com/docs/en/gitlab-ci-cd.md). For web lookups, use the [WebFetch tool](https://code.claude.com/docs/en/tools-reference.md#webfetch-tool-behavior) with a specific URL.243> **Alternatives:** for scheduling, use [`/loop`](https://code.claude.com/docs/en/scheduled-tasks) instead of `/schedule`. For cloud sessions, use [GitHub Actions](https://code.claude.com/docs/en/github-actions.md) or [GitLab CI/CD](https://code.claude.com/docs/en/gitlab-ci-cd.md). For web lookups, use the [WebFetch tool](https://code.claude.com/docs/en/tools-reference.md#webfetch-tool-behavior) with a specific URL.

244 

245**Claude Platform on AWS**

246 

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

248 

249**Available where Amazon Bedrock is not:** [web search](https://code.claude.com/docs/en/tools-reference.md#websearch-tool-behavior).

250 

251**Partial support:**

252 

253* [Cross-session messaging](https://code.claude.com/docs/en/cross-session-messaging.md): between your sessions on this machine only <sup>[5](#fn5)</sup>

254 

255**Alternatives:** for scheduling, use [`/loop`](https://code.claude.com/docs/en/scheduled-tasks) instead of `/schedule`. For cloud sessions, use [GitLab CI/CD](https://code.claude.com/docs/en/gitlab-ci-cd.md).

256 

257**Google Cloud's Agent Platform**

258 

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

260 

261**Partial support:**

262 

263* [Desktop](https://code.claude.com/docs/en/desktop.md): via [managed settings](https://claude.com/docs/third-party/claude-desktop/configuration) or [Claude Desktop on 3P](https://claude.com/docs/third-party/claude-desktop/overview)

264* [Web search](https://code.claude.com/docs/en/tools-reference.md#websearch-tool-behavior): Opus 4, Sonnet 4, Haiku 4.5, and later models

265* [Auto mode](https://code.claude.com/docs/en/auto-mode-config.md): Sonnet 5 or later, Opus 4.7 or later, Haiku 5.5, and Fable models only

266* [Cross-session messaging](https://code.claude.com/docs/en/cross-session-messaging.md): between your sessions on this machine only <sup>[5](#fn5)</sup>

267* [Zero Data Retention](https://code.claude.com/docs/en/zero-data-retention.md): subject to your Google Cloud agreement

268 

269**Alternatives:** for scheduling, use [`/loop`](https://code.claude.com/docs/en/scheduled-tasks) instead of `/schedule`. For cloud sessions, use [GitHub Actions](https://code.claude.com/docs/en/github-actions.md) or [GitLab CI/CD](https://code.claude.com/docs/en/gitlab-ci-cd.md).

270 

271**Microsoft Foundry**

272 

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

274 

275**Partial support:**

276 

277* [Desktop](https://code.claude.com/docs/en/desktop.md): only via [Claude Desktop on 3P](https://claude.com/docs/third-party/claude-desktop/overview)

278* [Auto mode](https://code.claude.com/docs/en/auto-mode-config.md): Sonnet 5 or later, Opus 4.7 or later, Haiku 5.5, and Fable models only

279* [Cross-session messaging](https://code.claude.com/docs/en/cross-session-messaging.md): between your sessions on this machine only <sup>[5](#fn5)</sup>

280* [Zero Data Retention](https://code.claude.com/docs/en/zero-data-retention.md): subject to your Azure agreement

281 

282**Alternatives:** for scheduling, use [`/loop`](https://code.claude.com/docs/en/scheduled-tasks) instead of `/schedule`. For cloud sessions, use [GitHub Actions](https://code.claude.com/docs/en/github-actions.md).

283 

284**Anthropic Console**

285 244 

286**Not available:** all [features that require a Claude subscription](#features-that-require-a-claude-subscription).245> [tab] Claude Platform on AWS

246>

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

248>

249> **Available where Amazon Bedrock is not:** [web search](https://code.claude.com/docs/en/tools-reference.md#websearch-tool-behavior).

250>

251> **Partial support:**

252>

253> * [Cross-session messaging](https://code.claude.com/docs/en/cross-session-messaging.md): between your sessions on this machine only <sup>[5](#fn5)</sup>

254>

255> **Alternatives:** for scheduling, use [`/loop`](https://code.claude.com/docs/en/scheduled-tasks) instead of `/schedule`. For cloud sessions, use [GitLab CI/CD](https://code.claude.com/docs/en/gitlab-ci-cd.md).

287 256 

288Everything in [CLI capabilities that vary by provider](#cli-capabilities-that-vary-by-provider) is available, except that [fast mode](https://code.claude.com/docs/en/fast-mode.md) with Claude Opus 5 or Claude Opus 4.8 requires [provisioned access](https://code.claude.com/docs/en/fast-mode.md#enable-fast-mode-for-your-organization). [Server-managed settings](https://code.claude.com/docs/en/server-managed-settings.md) that you configure in a claude.ai Team or Enterprise organization don't reach a session that authenticates with a Console API key. See [Platform availability](https://code.claude.com/docs/en/server-managed-settings.md#platform-availability) for how to cover those sessions.257> [tab] Google Cloud's Agent Platform

258>

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

260>

261> **Partial support:**

262>

263> * [Desktop](https://code.claude.com/docs/en/desktop.md): via [managed settings](https://claude.com/docs/third-party/claude-desktop/configuration) or [Claude Desktop on 3P](https://claude.com/docs/third-party/claude-desktop/overview)

264> * [Web search](https://code.claude.com/docs/en/tools-reference.md#websearch-tool-behavior): Opus 4, Sonnet 4, Haiku 4.5, and later models

265> * [Auto mode](https://code.claude.com/docs/en/auto-mode-config.md): Sonnet 5 or later, Opus 4.7 or later, Haiku 5.5, and Fable models only

266> * [Cross-session messaging](https://code.claude.com/docs/en/cross-session-messaging.md): between your sessions on this machine only <sup>[5](#fn5)</sup>

267> * [Zero Data Retention](https://code.claude.com/docs/en/zero-data-retention.md): subject to your Google Cloud agreement

268>

269> **Alternatives:** for scheduling, use [`/loop`](https://code.claude.com/docs/en/scheduled-tasks) instead of `/schedule`. For cloud sessions, use [GitHub Actions](https://code.claude.com/docs/en/github-actions.md) or [GitLab CI/CD](https://code.claude.com/docs/en/gitlab-ci-cd.md).

289 270 

290**Partial support:**271> [tab] Microsoft Foundry

272>

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

274>

275> **Partial support:**

276>

277> * [Desktop](https://code.claude.com/docs/en/desktop.md): only via [Claude Desktop on 3P](https://claude.com/docs/third-party/claude-desktop/overview)

278> * [Auto mode](https://code.claude.com/docs/en/auto-mode-config.md): Sonnet 5 or later, Opus 4.7 or later, Haiku 5.5, and Fable models only

279> * [Cross-session messaging](https://code.claude.com/docs/en/cross-session-messaging.md): between your sessions on this machine only <sup>[5](#fn5)</sup>

280> * [Zero Data Retention](https://code.claude.com/docs/en/zero-data-retention.md): subject to your Azure agreement

281>

282> **Alternatives:** for scheduling, use [`/loop`](https://code.claude.com/docs/en/scheduled-tasks) instead of `/schedule`. For cloud sessions, use [GitHub Actions](https://code.claude.com/docs/en/github-actions.md).

291 283 

292* [Desktop](https://code.claude.com/docs/en/desktop.md): via [Claude Desktop on 3P with the Claude API](https://claude.com/docs/third-party/claude-desktop/claude-api)284> [tab] Anthropic Console

285>

286> **Not available:** all [features that require a Claude subscription](#features-that-require-a-claude-subscription).

287>

288> Everything in [CLI capabilities that vary by provider](#cli-capabilities-that-vary-by-provider) is available, except that [fast mode](https://code.claude.com/docs/en/fast-mode.md) with Claude Opus 5 or Claude Opus 4.8 requires [provisioned access](https://code.claude.com/docs/en/fast-mode.md#enable-fast-mode-for-your-organization). [Server-managed settings](https://code.claude.com/docs/en/server-managed-settings.md) that you configure in a claude.ai Team or Enterprise organization don't reach a session that authenticates with a Console API key. See [Platform availability](https://code.claude.com/docs/en/server-managed-settings.md#platform-availability) for how to cover those sessions.

289>

290> **Partial support:**

291>

292> * [Desktop](https://code.claude.com/docs/en/desktop.md): via [Claude Desktop on 3P with the Claude API](https://claude.com/docs/third-party/claude-desktop/claude-api)

293 293 

294## Availability by subscription plan294## Availability by subscription plan

295 295 


297 297 

298In Enterprise organizations with the [HIPAA configuration](https://code.claude.com/docs/en/hipaa-setup.md) applied, some features in this table are turned off.298In Enterprise organizations with the [HIPAA configuration](https://code.claude.com/docs/en/hipaa-setup.md) applied, some features in this table are turned off.

299 299 

300| Feature | Pro | Max | Team | Enterprise |300| Feature | Pro | Max | Ultra | Team | Enterprise |

301| :- | :- | :- | :- | :- |301| :- | :- | :- | :- | :- | :- |

302| [Cloud sessions](https://code.claude.com/docs/en/claude-code-on-the-web.md) | ✓ | ✓ | ✓ | ✓ <sup>[6](#fn6)</sup> |302| [Cloud sessions](https://code.claude.com/docs/en/claude-code-on-the-web.md) | ✓ | ✓ | ✓ | ✓ | ✓ <sup>[6](#fn6)</sup> |

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

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

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

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

307| Dispatch ([Desktop](https://code.claude.com/docs/en/desktop.md#sessions-from-dispatch)) | ✓ | ✓ | ✗ | ✗ |307| Dispatch ([Desktop](https://code.claude.com/docs/en/desktop.md#sessions-from-dispatch)) | ✓ | ✓ | ✓ | ✗ | ✗ |

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

309| [Artifacts](https://code.claude.com/docs/en/artifacts.md) | ✓ | ✓ | ✓ | ✓ |309| [Artifacts](https://code.claude.com/docs/en/artifacts.md) | ✓ | ✓ | ✓ | ✓ | ✓ |

310| [Analytics dashboard and contribution metrics](https://code.claude.com/docs/en/analytics.md) | ✗ | ✗ | ✓ | ✓ |310| [Analytics dashboard and contribution metrics](https://code.claude.com/docs/en/analytics.md) | ✗ | ✗ | ✗ | ✓ | ✓ |

311| [Enterprise Analytics API](https://code.claude.com/docs/en/analytics.md#access-data-programmatically) | ✗ | ✗ | ✗ | ✓ |311| [Enterprise Analytics API](https://code.claude.com/docs/en/analytics.md#access-data-programmatically) | ✗ | ✗ | ✗ | ✗ | ✓ |

312| [Server-managed settings](https://code.claude.com/docs/en/server-managed-settings.md) | ✗ | ✗ | ✓ | ✓ |312| [Server-managed settings](https://code.claude.com/docs/en/server-managed-settings.md) | ✗ | ✗ | ✗ | ✓ | ✓ |

313| [SSO](https://support.claude.com/en/articles/9266767-what-is-the-team-plan) | ✗ | ✗ | ✓ | ✓ |313| [SSO](https://support.claude.com/en/articles/9266767-what-is-the-team-plan) | ✗ | ✗ | ✗ | ✓ | ✓ |

314| SCIM | ✗ | ✗ | ✗ | ✓ |314| SCIM | ✗ | ✗ | ✗ | ✗ | ✓ |

315| [Compliance API](https://platform.claude.com/docs/en/api/compliance) | ✗ | ✗ | ✗ | ✓ |315| [Compliance API](https://platform.claude.com/docs/en/api/compliance) | ✗ | ✗ | ✗ | ✗ | ✓ |

316| [Zero Data Retention](https://code.claude.com/docs/en/zero-data-retention.md) | ✗ | ✗ | ✗ | ✓ <sup>[7](#fn7)</sup> |316| [Zero Data Retention](https://code.claude.com/docs/en/zero-data-retention.md) | ✗ | ✗ | ✗ | ✗ | ✓ <sup>[7](#fn7)</sup> |

317 317 

318<sup>6</sup> On Enterprise, requires a premium seat or a Chat + Claude Code seat. See [Use Claude Code in the cloud](https://code.claude.com/docs/en/claude-code-on-the-web.md).\318<sup>6</sup> On Enterprise, requires a premium seat or a Chat + Claude Code seat. See [Use Claude Code in the cloud](https://code.claude.com/docs/en/claude-code-on-the-web.md).\

319 319 


321 321 

322For pricing and the full plan comparison, see [Team plans](https://support.claude.com/en/articles/9266767-what-is-the-team-plan) and [Enterprise plans](https://support.claude.com/en/articles/9797531-what-is-the-enterprise-plan).322For pricing and the full plan comparison, see [Team plans](https://support.claude.com/en/articles/9266767-what-is-the-team-plan) and [Enterprise plans](https://support.claude.com/en/articles/9797531-what-is-the-enterprise-plan).

323 323 

324### Ultra plan

325 

326Ultra is the new name for the Max 20x plan, and Max is the new name for Max 5x. To check which plan you're on, see your subscription on claude.ai.

327 

328In Claude Code, Max and Ultra have the same features, listed in the Max and Ultra columns of the [availability table](#availability-by-subscription-plan). For usage limits and pricing, see the [Claude pricing page](https://claude.com/pricing).

329 

324## Model availability330## Model availability

325 331 

326For which Claude models and context-window sizes are available per provider and region, see [Model configuration](https://code.claude.com/docs/en/model-config.md) and the [Models overview](https://platform.claude.com/docs/en/about-claude/models/overview). Vision, PDF input, and extended thinking are model capabilities rather than Claude Code features and work on every provider that offers the model. [Prompt caching](https://code.claude.com/docs/en/prompt-caching.md) works the same way on most providers; on Amazon Bedrock, support varies by model.332For which Claude models and context-window sizes are available per provider and region, see [Model configuration](https://code.claude.com/docs/en/model-config.md) and the [Models overview](https://platform.claude.com/docs/en/about-claude/models/overview). Vision, PDF input, and extended thinking are model capabilities rather than Claude Code features and work on every provider that offers the model. [Prompt caching](https://code.claude.com/docs/en/prompt-caching.md) works the same way on most providers; on Amazon Bedrock, support varies by model.

features-overview.md +193 −193

Details

72 72 

73Some features can seem similar. For a deeper walkthrough of choosing between them, see [Steering Claude Code: when to use CLAUDE.md, skills, hooks, and subagents](https://claude.com/blog/steering-claude-code-skills-hooks-rules-subagents-and-more) on the blog. Here's how to tell them apart.73Some features can seem similar. For a deeper walkthrough of choosing between them, see [Steering Claude Code: when to use CLAUDE.md, skills, hooks, and subagents](https://claude.com/blog/steering-claude-code-skills-hooks-rules-subagents-and-more) on the blog. Here's how to tell them apart.

74 74 

75**Skill vs Subagent**75> [tab] Skill vs Subagent

76 76>

77Skills and subagents solve different problems:77> Skills and subagents solve different problems:

78 78>

79* **Skills** are reusable content you can load into any context79> * **Skills** are reusable content you can load into any context

80* **Subagents** are isolated workers that run separately from your main conversation80> * **Subagents** are isolated workers that run separately from your main conversation

81 81>

82| Aspect | Skill | Subagent |82> | Aspect | Skill | Subagent |

83| - | - | - |83> | - | - | - |

84| **What it is** | Reusable instructions, knowledge, or workflows | Isolated worker with its own context |84> | **What it is** | Reusable instructions, knowledge, or workflows | Isolated worker with its own context |

85| **Key benefit** | Share content across contexts | Context isolation. Work happens separately, only summary returns |85> | **Key benefit** | Share content across contexts | Context isolation. Work happens separately, only summary returns |

86| **[Context window](https://code.claude.com/docs/en/context-window.md) impact** | Adds to your main window | Uses a separate window with its own input and output tokens |86> | **[Context window](https://code.claude.com/docs/en/context-window.md) impact** | Adds to your main window | Uses a separate window with its own input and output tokens |

87| **Best for** | Reference material, invocable workflows | Tasks that read many files, parallel work, specialized workers |87> | **Best for** | Reference material, invocable workflows | Tasks that read many files, parallel work, specialized workers |

88 88>

89**Skills can be reference or action.** Reference skills provide knowledge Claude uses throughout your session (like your API style guide). Action skills tell Claude to do something specific (like `/deploy` that runs your deployment workflow).89> **Skills can be reference or action.** Reference skills provide knowledge Claude uses throughout your session (like your API style guide). Action skills tell Claude to do something specific (like `/deploy` that runs your deployment workflow).

90 90>

91**Use a subagent** when you need context isolation or when your context window is getting full. The subagent might read dozens of files or run extensive searches, but your main conversation only receives a summary. Since subagent work doesn't consume your main context, this is also useful when you don't need the intermediate work to remain visible. Custom subagents can have their own instructions and can preload skills.91> **Use a subagent** when you need context isolation or when your context window is getting full. The subagent might read dozens of files or run extensive searches, but your main conversation only receives a summary. Since subagent work doesn't consume your main context, this is also useful when you don't need the intermediate work to remain visible. Custom subagents can have their own instructions and can preload skills.

92 92>

93**They can combine.** A subagent can preload specific skills (`skills:` field). A skill can run in isolated context using `context: fork`. See [Skills](https://code.claude.com/docs/en/skills.md) for details.93> **They can combine.** A subagent can preload specific skills (`skills:` field). A skill can run in isolated context using `context: fork`. See [Skills](https://code.claude.com/docs/en/skills.md) for details.

94 

95**CLAUDE.md vs Skill**

96 

97Both store instructions, but they load differently and serve different purposes.

98 

99| Aspect | CLAUDE.md | Skill |

100| - | - | - |

101| **Loads** | Every session, automatically | On demand |

102| **Can include files** | Yes, with `@path` imports | Yes, with `@path` imports |

103| **Can trigger workflows** | No | Yes, with `/<name>` |

104| **Best for** | "Always do X" rules | Reference material, invocable workflows |

105 

106**Put it in CLAUDE.md** if Claude should always know it: coding conventions, build commands, project structure, "never do X" rules.

107 

108**Put it in a skill** if it's reference material Claude needs sometimes (API docs, style guides) or a workflow you trigger with `/<name>` (deploy, review, release).

109 

110**Rule of thumb:** Keep CLAUDE.md under 200 lines. If it's growing, move reference content to skills or split into [`.claude/rules/`](https://code.claude.com/docs/en/memory#organize-rules-with-claude/rules/) files.

111 

112**CLAUDE.md vs Output style**

113 

114Both give Claude standing instructions. CLAUDE.md carries what Claude should know, and an output style sets how Claude responds.

115 

116| Aspect | CLAUDE.md | Output style |

117| - | - | - |

118| **Holds** | Facts and rules about your project | A role, tone, and response format |

119| **Switching** | Always loaded | One active at a time; [switch styles](https://code.claude.com/docs/en/output-styles.md#change-your-output-style) whenever you want |

120| **Best for** | Build commands, conventions, "never do X" rules | Shorter responses, explanations alongside code, a non-engineering role |

121 

122**Put it in CLAUDE.md** if it's true of the project whatever style you're in: coding conventions, build commands, project structure.

123 

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

125 

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

127 

128**CLAUDE.md vs Rules vs Skills**

129 

130All three store instructions, but they load differently:

131 

132| Aspect | CLAUDE.md | `.claude/rules/` | Skill |

133| - | - | - | - |

134| **Loads** | Every session | Every session, or when matching files are opened | On demand, when invoked or relevant |

135| **Scope** | Whole project | Can be scoped to file paths | Task-specific |

136| **Best for** | Core conventions and build commands | Language-specific or directory-specific guidelines | Reference material, repeatable workflows |

137 

138**Use CLAUDE.md** for instructions every session needs: build commands, test conventions, project architecture.

139 

140**Use rules** to keep CLAUDE.md focused. Rules with [`paths` frontmatter](https://code.claude.com/docs/en/memory#path-specific-rules) only load when Claude works with matching files, saving context.

141 

142**Use skills** for content Claude only needs sometimes, like API documentation or a deployment checklist you trigger with `/<name>`.

143 

144**Subagent vs Dynamic workflow**

145 

146Both do work outside your main conversation. With subagents, Claude decides turn by turn what runs next. In a workflow, the script decides:

147 

148* **Subagents** are workers Claude spawns, each returning a summary to the conversation that spawned it

149* **[Dynamic workflows](https://code.claude.com/docs/en/workflows.md)** are scripts Claude writes that run many subagents in the background and return one result

150 

151**Use a subagent** when you need a quick, focused worker: research a question, verify a claim, review a file. The subagent does the work and returns a summary, so your main conversation stays clean. Subagents that Claude [named](https://code.claude.com/docs/en/sub-agents.md#subagent-names) when it spawned them can also [message each other](https://code.claude.com/docs/en/sub-agents.md#what-loads-at-startup).

152 

153**Use a dynamic workflow** when a job [outgrows a handful of subagents](https://code.claude.com/docs/en/workflows.md#when-to-use-a-workflow), or when you want the findings cross-checked before you see them, such as a codebase-wide audit, a large migration, or a plan drafted from several angles. To start one, [ask for a workflow in your prompt](https://code.claude.com/docs/en/workflows.md#ask-for-a-workflow-in-your-prompt).

154 

155**To pass a finding from one of your sessions to another**, ask the first session's Claude to send it. Claude delivers it with [cross-session messaging](https://code.claude.com/docs/en/cross-session-messaging.md). [Run agents in parallel](https://code.claude.com/docs/en/agents.md) compares the other ways to run more than one Claude at once, including sessions you hand off and check back on later.

156 

157**MCP vs Skill**

158 

159MCP connects Claude to external services. Skills extend what Claude knows, including how to use those services effectively.

160 

161| Aspect | MCP | Skill |

162| - | - | - |

163| **What it is** | Protocol for connecting to external services | Knowledge, workflows, and reference material |

164| **Provides** | Tools and data access | Knowledge, workflows, reference material |

165| **Examples** | Slack integration, database queries, browser control | Code review checklist, deploy workflow, API style guide |

166 

167These solve different problems and work well together:

168 

169**MCP** gives Claude purpose-built tools for an external system, with the connection and authentication handled by the server.

170 

171**Skills** give Claude knowledge about how to use those tools effectively, plus workflows you can trigger with `/<name>`. A skill might include your team's database schema and query patterns, or a `/post-to-slack` workflow with your team's message formatting rules.

172 

173**Hook vs Skill**

174 94 

175Claude Code runs a hook at a lifecycle event; it loads a skill into context for Claude to apply.95> [tab] CLAUDE.md vs Skill

96>

97> Both store instructions, but they load differently and serve different purposes.

98>

99> | Aspect | CLAUDE.md | Skill |

100> | - | - | - |

101> | **Loads** | Every session, automatically | On demand |

102> | **Can include files** | Yes, with `@path` imports | Yes, with `@path` imports |

103> | **Can trigger workflows** | No | Yes, with `/<name>` |

104> | **Best for** | "Always do X" rules | Reference material, invocable workflows |

105>

106> **Put it in CLAUDE.md** if Claude should always know it: coding conventions, build commands, project structure, "never do X" rules.

107>

108> **Put it in a skill** if it's reference material Claude needs sometimes (API docs, style guides) or a workflow you trigger with `/<name>` (deploy, review, release).

109>

110> **Rule of thumb:** Keep CLAUDE.md under 200 lines. If it's growing, move reference content to skills or split into [`.claude/rules/`](https://code.claude.com/docs/en/memory#organize-rules-with-claude/rules/) files.

176 111 

177| Aspect | Hook | Skill |112> [tab] CLAUDE.md vs Output style

178| - | - | - |113>

179| **Runs** | A shell command, HTTP request, MCP tool call, LLM prompt, or subagent | Instructions Claude reads and follows |114> Both give Claude standing instructions. CLAUDE.md carries what Claude should know, and an output style sets how Claude responds.

180| **Triggered by** | [Lifecycle events](https://code.claude.com/docs/en/hooks.md#hook-events) such as `PostToolUse` or `SessionStart` | You typing `/<name>`, or Claude matching the description to your task |115>

181| **Determinism** | Fires on its event without Claude deciding | Claude interprets the instructions; outcome can vary |116> | Aspect | CLAUDE.md | Output style |

182| **Context cost** | Zero unless the hook returns output | Description loads each session; full content loads when used |117> | - | - | - |

183| **Best for** | Linting after edits, blocking unsafe commands, logging, notifications | Workflows that need reasoning, reference material, multi-step tasks |118> | **Holds** | Facts and rules about your project | A role, tone, and response format |

119> | **Switching** | Always loaded | One active at a time; [switch styles](https://code.claude.com/docs/en/output-styles.md#change-your-output-style) whenever you want |

120> | **Best for** | Build commands, conventions, "never do X" rules | Shorter responses, explanations alongside code, a non-engineering role |

121>

122> **Put it in CLAUDE.md** if it's true of the project whatever style you're in: coding conventions, build commands, project structure.

123>

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

125>

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

184 127 

185**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.128> [tab] CLAUDE.md vs Rules vs Skills

129>

130> All three store instructions, but they load differently:

131>

132> | Aspect | CLAUDE.md | `.claude/rules/` | Skill |

133> | - | - | - | - |

134> | **Loads** | Every session | Every session, or when matching files are opened | On demand, when invoked or relevant |

135> | **Scope** | Whole project | Can be scoped to file paths | Task-specific |

136> | **Best for** | Core conventions and build commands | Language-specific or directory-specific guidelines | Reference material, repeatable workflows |

137>

138> **Use CLAUDE.md** for instructions every session needs: build commands, test conventions, project architecture.

139>

140> **Use rules** to keep CLAUDE.md focused. Rules with [`paths` frontmatter](https://code.claude.com/docs/en/memory#path-specific-rules) only load when Claude works with matching files, saving context.

141>

142> **Use skills** for content Claude only needs sometimes, like API documentation or a deployment checklist you trigger with `/<name>`.

186 143 

187**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.144> [tab] Subagent vs Dynamic workflow

145>

146> Both do work outside your main conversation. With subagents, Claude decides turn by turn what runs next. In a workflow, the script decides:

147>

148> * **Subagents** are workers Claude spawns, each returning a summary to the conversation that spawned it

149> * **[Dynamic workflows](https://code.claude.com/docs/en/workflows.md)** are scripts Claude writes that run many subagents in the background and return one result

150>

151> **Use a subagent** when you need a quick, focused worker: research a question, verify a claim, review a file. The subagent does the work and returns a summary, so your main conversation stays clean. Subagents that Claude [named](https://code.claude.com/docs/en/sub-agents.md#subagent-names) when it spawned them can also [message each other](https://code.claude.com/docs/en/sub-agents.md#what-loads-at-startup).

152>

153> **Use a dynamic workflow** when a job [outgrows a handful of subagents](https://code.claude.com/docs/en/workflows.md#when-to-use-a-workflow), or when you want the findings cross-checked before you see them, such as a codebase-wide audit, a large migration, or a plan drafted from several angles. To start one, [ask for a workflow in your prompt](https://code.claude.com/docs/en/workflows.md#ask-for-a-workflow-in-your-prompt).

154>

155> **To pass a finding from one of your sessions to another**, ask the first session's Claude to send it. Claude delivers it with [cross-session messaging](https://code.claude.com/docs/en/cross-session-messaging.md). [Run agents in parallel](https://code.claude.com/docs/en/agents.md) compares the other ways to run more than one Claude at once, including sessions you hand off and check back on later.

188 156 

189**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.157> [tab] MCP vs Skill

158>

159> MCP connects Claude to external services. Skills extend what Claude knows, including how to use those services effectively.

160>

161> | Aspect | MCP | Skill |

162> | - | - | - |

163> | **What it is** | Protocol for connecting to external services | Knowledge, workflows, and reference material |

164> | **Provides** | Tools and data access | Knowledge, workflows, reference material |

165> | **Examples** | Slack integration, database queries, browser control | Code review checklist, deploy workflow, API style guide |

166>

167> These solve different problems and work well together:

168>

169> **MCP** gives Claude purpose-built tools for an external system, with the connection and authentication handled by the server.

170>

171> **Skills** give Claude knowledge about how to use those tools effectively, plus workflows you can trigger with `/<name>`. A skill might include your team's database schema and query patterns, or a `/post-to-slack` workflow with your team's message formatting rules.

190 172 

191**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.173> [tab] Hook vs Skill

174>

175> Claude Code runs a hook at a lifecycle event; it loads a skill into context for Claude to apply.

176>

177> | Aspect | Hook | Skill |

178> | - | - | - |

179> | **Runs** | A shell command, HTTP request, MCP tool call, LLM prompt, or subagent | Instructions Claude reads and follows |

180> | **Triggered by** | [Lifecycle events](https://code.claude.com/docs/en/hooks.md#hook-events) such as `PostToolUse` or `SessionStart` | You typing `/<name>`, or Claude matching the description to your task |

181> | **Determinism** | Fires on its event without Claude deciding | Claude interprets the instructions; outcome can vary |

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

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

184>

185> **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.

186>

187> **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.

188>

189> **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.

190>

191> **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.

192 192 

193### Understand how features layer193### Understand how features layer

194 194 


238 238 

239![Context loading: CLAUDE.md loads at session start and stays in every request. MCP tool names load at start with full schemas deferred until use. Skills load descriptions at start, full content on invocation. Subagents get isolated context. Hooks run externally.](https://mintcdn.com/claude-code/ikqp3_70mqIahteV/images/context-loading.svg?fit=max\&auto=format\&n=ikqp3_70mqIahteV\&q=85\&s=aab139e750494a237ae2e0c8f9139b0a)239![Context loading: CLAUDE.md loads at session start and stays in every request. MCP tool names load at start with full schemas deferred until use. Skills load descriptions at start, full content on invocation. Subagents get isolated context. Hooks run externally.](https://mintcdn.com/claude-code/ikqp3_70mqIahteV/images/context-loading.svg?fit=max\&auto=format\&n=ikqp3_70mqIahteV\&q=85\&s=aab139e750494a237ae2e0c8f9139b0a)

240 240 

241**CLAUDE.md**241> [tab] CLAUDE.md

242 

243**When:** Session start

244 

245**What loads:** Full content of each CLAUDE.md file that loads at session start (managed, user, and project levels).

246 

247**Inheritance:** Claude reads CLAUDE.md files from your working directory up to the root, and discovers nested ones in subdirectories as it accesses those files. See [How CLAUDE.md files load](https://code.claude.com/docs/en/memory.md#how-claude-md-files-load) for details. If a nested CLAUDE.md is over its [per-file size limit](https://code.claude.com/docs/en/memory.md#claude-ignores-the-end-of-my-subdirectory-claude-md), Claude receives only the start of the file.

248 

249> [!TIP]

250>242>

251> Keep CLAUDE.md under 200 lines. Move reference material to skills, which load on demand. To get [trim proposals for a checked-in CLAUDE.md](https://code.claude.com/docs/en/memory.md#my-claude-md-is-too-large), run `/doctor`.243> **When:** Session start

252 

253**Skills**

254 

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

256 

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

258 

259**What loads:** For model-invocable skills, Claude sees names and descriptions in every request. When you invoke a skill with `/<name>` or Claude loads it automatically, the full content loads into your conversation.

260 

261**How Claude chooses skills:** Claude matches your task against skill descriptions to decide which are relevant. If descriptions are vague or overlap, Claude may load the wrong skill or miss one that would help. To tell Claude to use a specific skill, invoke it with `/<name>`.

262 

263**Context cost:** Low until used. User-only skills have zero cost until invoked.

264 

265**In subagents:** The full content of skills listed in a subagent's `skills` field [loads into its context at launch](https://code.claude.com/docs/en/sub-agents.md#preload-skills-into-subagents), rather than on demand. Subagents can still discover and invoke unlisted project, user, and plugin skills through the Skill tool.

266 

267> [!TIP]

268>244>

269> Use `disable-model-invocation: true` for skills with side effects. This saves context and ensures they run only when you name them.245> **What loads:** Full content of each CLAUDE.md file that loads at session start (managed, user, and project levels).

270 

271**MCP servers**

272 

273**When:** Session start.

274 

275**What loads:** Tool names and server instructions from connected servers. Full JSON schemas stay deferred until Claude needs a specific tool.

276 

277**Context cost:** [Tool search](https://code.claude.com/docs/en/mcp.md#scale-with-mcp-tool-search) is on by default, so idle MCP tools consume minimal context.

278 

279> [!TIP]

280>246>

281> Run `/mcp` to see each server's connection status. Run `/context all` to see how many tokens each loaded MCP tool uses. Claude Code [reconnects to remote servers automatically](https://code.claude.com/docs/en/mcp.md#automatic-reconnection) if they drop, and you can disconnect servers you're not actively using.247> **Inheritance:** Claude reads CLAUDE.md files from your working directory up to the root, and discovers nested ones in subdirectories as it accesses those files. See [How CLAUDE.md files load](https://code.claude.com/docs/en/memory.md#how-claude-md-files-load) for details. If a nested CLAUDE.md is over its [per-file size limit](https://code.claude.com/docs/en/memory.md#claude-ignores-the-end-of-my-subdirectory-claude-md), Claude receives only the start of the file.

282 

283**Code intelligence**

284 

285**When:** After file edits, and on demand when Claude navigates code.

286 

287**What loads:** Type errors and warnings after each file edit. Definition, reference, and type information when Claude looks up a symbol.

288 

289**Context cost:** Low. Symbol lookups often replace broad file reads, so net context use can go down.

290 

291> [!TIP]

292>248>

293> The LSP tool is inactive until you install a [code intelligence plugin](https://code.claude.com/docs/en/plugins/code-intelligence.md) for your language.249> > [!TIP]

294 250> >

295**Subagents**251> > Keep CLAUDE.md under 200 lines. Move reference material to skills, which load on demand. To get [trim proposals for a checked-in CLAUDE.md](https://code.claude.com/docs/en/memory.md#my-claude-md-is-too-large), run `/doctor`.

296 

297**When:** On demand, when you or Claude spawns one for a task.

298 

299**What loads:** Fresh, isolated context containing:

300 

301* The agent's own system prompt, not the Claude Code system prompt

302* Full content of skills listed in the agent's `skills:` field

303* CLAUDE.md and git status. The built-in Explore and Plan agents [start with neither](https://code.claude.com/docs/en/sub-agents.md#what-loads-at-startup), and an agent whose definition sets [`omitClaudeMd`](https://code.claude.com/docs/en/sub-agents#supported-frontmatter-fields) starts without the user, project, and local CLAUDE.md files.

304* Whatever context the lead agent passes in the prompt

305 

306For a [fork](https://code.claude.com/docs/en/sub-agents.md#fork-the-current-conversation), Claude Code loads the parent's conversation so far, system prompt, and tools instead.

307 

308**Context cost:** Isolated from main session.

309 252 

310> [!TIP]253> [tab] Skills

311>254>

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

313 256>

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

258>

259> **What loads:** For model-invocable skills, Claude sees names and descriptions in every request. When you invoke a skill with `/<name>` or Claude loads it automatically, the full content loads into your conversation.

260>

261> **How Claude chooses skills:** Claude matches your task against skill descriptions to decide which are relevant. If descriptions are vague or overlap, Claude may load the wrong skill or miss one that would help. To tell Claude to use a specific skill, invoke it with `/<name>`.

262>

263> **Context cost:** Low until used. User-only skills have zero cost until invoked.

264>

265> **In subagents:** The full content of skills listed in a subagent's `skills` field [loads into its context at launch](https://code.claude.com/docs/en/sub-agents.md#preload-skills-into-subagents), rather than on demand. Subagents can still discover and invoke unlisted project, user, and plugin skills through the Skill tool.

266>

267> > [!TIP]

268> >

269> > Use `disable-model-invocation: true` for skills with side effects. This saves context and ensures they run only when you name them.

315 270 

316**When:** On trigger. Claude Code runs hooks at specific lifecycle events like tool execution, session boundaries, prompt submission, permission requests, and compaction. See [Hooks](https://code.claude.com/docs/en/hooks.md) for the full list.271> [tab] MCP servers

272>

273> **When:** Session start.

274>

275> **What loads:** Tool names and server instructions from connected servers. Full JSON schemas stay deferred until Claude needs a specific tool.

276>

277> **Context cost:** [Tool search](https://code.claude.com/docs/en/mcp.md#scale-with-mcp-tool-search) is on by default, so idle MCP tools consume minimal context.

278>

279> > [!TIP]

280> >

281> > Run `/mcp` to see each server's connection status. Run `/context all` to see how many tokens each loaded MCP tool uses. Claude Code [reconnects to remote servers automatically](https://code.claude.com/docs/en/mcp.md#automatic-reconnection) if they drop, and you can disconnect servers you're not actively using.

317 282 

318**What loads:** Nothing by default. Hooks execute outside the main conversation.283> [tab] Code intelligence

284>

285> **When:** After file edits, and on demand when Claude navigates code.

286>

287> **What loads:** Type errors and warnings after each file edit. Definition, reference, and type information when Claude looks up a symbol.

288>

289> **Context cost:** Low. Symbol lookups often replace broad file reads, so net context use can go down.

290>

291> > [!TIP]

292> >

293> > The LSP tool is inactive until you install a [code intelligence plugin](https://code.claude.com/docs/en/plugins/code-intelligence.md) for your language.

319 294 

320**Context cost:** Zero, unless the hook returns output that gets added as messages to your conversation.295> [tab] Subagents

296>

297> **When:** On demand, when you or Claude spawns one for a task.

298>

299> **What loads:** Fresh, isolated context containing:

300>

301> * The agent's own system prompt, not the Claude Code system prompt

302> * Full content of skills listed in the agent's `skills:` field

303> * CLAUDE.md and git status. The built-in Explore and Plan agents [start with neither](https://code.claude.com/docs/en/sub-agents.md#what-loads-at-startup), and an agent whose definition sets [`omitClaudeMd`](https://code.claude.com/docs/en/sub-agents#supported-frontmatter-fields) starts without the user, project, and local CLAUDE.md files.

304> * Whatever context the lead agent passes in the prompt

305>

306> For a [fork](https://code.claude.com/docs/en/sub-agents.md#fork-the-current-conversation), Claude Code loads the parent's conversation so far, system prompt, and tools instead.

307>

308> **Context cost:** Isolated from main session.

309>

310> > [!TIP]

311> >

312> > Use subagents for work that doesn't need your full conversation context. Their isolation prevents bloating your main session.

321 313 

322> [!TIP]314> [tab] Hooks

315>

316> **When:** On trigger. Claude Code runs hooks at specific lifecycle events like tool execution, session boundaries, prompt submission, permission requests, and compaction. See [Hooks](https://code.claude.com/docs/en/hooks.md) for the full list.

317>

318> **What loads:** Nothing by default. Hooks execute outside the main conversation.

319>

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

323>321>

324> Hooks are ideal for side effects (linting, logging) that don't need to affect Claude's context.322> > [!TIP]

323> >

324> > Hooks are ideal for side effects (linting, logging) that don't need to affect Claude's context.

325 325 

326## Learn more326## Learn more

327 327 

328Each feature has its own guide with setup instructions, examples, and configuration options.328Each feature has its own guide with setup instructions, examples, and configuration options.

329 329 

330> **[CLAUDE.md](https://code.claude.com/docs/en/memory.md)**330> [card] [CLAUDE.md](https://code.claude.com/docs/en/memory.md)

331>331>

332> Store project context, conventions, and instructions332> Store project context, conventions, and instructions

333 333 

334> **[Skills](https://code.claude.com/docs/en/skills.md)**334> [card] [Skills](https://code.claude.com/docs/en/skills.md)

335>335>

336> Give Claude domain expertise and reusable workflows336> Give Claude domain expertise and reusable workflows

337 337 

338> **[Subagents](https://code.claude.com/docs/en/sub-agents.md)**338> [card] [Subagents](https://code.claude.com/docs/en/sub-agents.md)

339>339>

340> Offload work to isolated context340> Offload work to isolated context

341 341 

342> **[Dynamic workflows](https://code.claude.com/docs/en/workflows.md)**342> [card] [Dynamic workflows](https://code.claude.com/docs/en/workflows.md)

343>343>

344> Run many subagents from one script344> Run many subagents from one script

345 345 

346> **[Cross-session messaging](https://code.claude.com/docs/en/cross-session-messaging.md)**346> [card] [Cross-session messaging](https://code.claude.com/docs/en/cross-session-messaging.md)

347>347>

348> Let Claude message your other sessions348> Let Claude message your other sessions

349 349 

350> **[MCP](https://code.claude.com/docs/en/mcp.md)**350> [card] [MCP](https://code.claude.com/docs/en/mcp.md)

351>351>

352> Connect Claude to external services352> Connect Claude to external services

353 353 

354> **[Hooks](https://code.claude.com/docs/en/hooks-guide.md)**354> [card] [Hooks](https://code.claude.com/docs/en/hooks-guide.md)

355>355>

356> Automate actions with hooks356> Automate actions with hooks

357 357 

358> **[Plugins](https://code.claude.com/docs/en/plugins/overview.md)**358> [card] [Plugins](https://code.claude.com/docs/en/plugins/overview.md)

359>359>

360> Bundle and share feature sets360> Bundle and share feature sets

361 361 

362> **[Marketplaces](https://code.claude.com/docs/en/plugins/create-marketplace.md)**362> [card] [Marketplaces](https://code.claude.com/docs/en/plugins/create-marketplace.md)

363>363>

364> Host and distribute plugin collections364> Host and distribute plugin collections

Details

74Add one of the following secrets to your repository, depending on how you authenticate. See GitHub's guide to [using secrets in GitHub Actions](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions).74Add one of the following secrets to your repository, depending on how you authenticate. See GitHub's guide to [using secrets in GitHub Actions](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions).

75 75 

76* `ANTHROPIC_API_KEY`: a Claude API key from the [Claude Console](https://platform.claude.com)76* `ANTHROPIC_API_KEY`: a Claude API key from the [Claude Console](https://platform.claude.com)

77* `CLAUDE_CODE_OAUTH_TOKEN`: an OAuth token that authenticates with your Claude subscription, available on Pro, Max, Team, and Enterprise plans. Generate one by running `claude setup-token` locally. See [Generate a long-lived token](https://code.claude.com/docs/en/authentication.md#generate-a-long-lived-token)77* `CLAUDE_CODE_OAUTH_TOKEN`: an OAuth token that authenticates with your Claude subscription, available on Pro, Max, Ultra, Team, and Enterprise plans. Generate one by running `claude setup-token` locally. See [Generate a long-lived token](https://code.claude.com/docs/en/authentication.md#generate-a-long-lived-token)

78 78 

79In workflow files, pass the secret to the matching input: `anthropic_api_key` for an API key, or `claude_code_oauth_token` for an OAuth token.79In workflow files, pass the secret to the matching input: `anthropic_api_key` for an API key, or `claude_code_oauth_token` for an OAuth token.

80 80 

Details

59 59 

60Configure your cloud to trust the OIDC token that GitHub issues to the workflow, so each workflow run gets short-lived cloud credentials. The bullets in each tab summarize what to create, and each tab links the cloud vendor's own guide for the console-level steps.60Configure your cloud to trust the OIDC token that GitHub issues to the workflow, so each workflow run gets short-lived cloud credentials. The bullets in each tab summarize what to create, and each tab links the cloud vendor's own guide for the console-level steps.

61 61 

62**Amazon Bedrock**62> [tab] Amazon Bedrock

63 63>

64Create the trust configuration in your AWS account, following the [AWS guide to creating OIDC identity providers](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_oidc.html):64> Create the trust configuration in your AWS account, following the [AWS guide to creating OIDC identity providers](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_oidc.html):

65 65>

66* Add a GitHub OIDC identity provider with provider URL `https://token.actions.githubusercontent.com` and audience `sts.amazonaws.com`66> * Add a GitHub OIDC identity provider with provider URL `https://token.actions.githubusercontent.com` and audience `sts.amazonaws.com`

67* Create an IAM role trusted by that provider as a web identity, and attach the scoped invocation policy from [IAM configuration](https://code.claude.com/docs/en/amazon-bedrock.md#iam-configuration), which grants `bedrock:InvokeModel`, `bedrock:InvokeModelWithResponseStream`, `bedrock:ListInferenceProfiles`, and `bedrock:GetInferenceProfile`, along with two `aws-marketplace` subscription actions67> * Create an IAM role trusted by that provider as a web identity, and attach the scoped invocation policy from [IAM configuration](https://code.claude.com/docs/en/amazon-bedrock.md#iam-configuration), which grants `bedrock:InvokeModel`, `bedrock:InvokeModelWithResponseStream`, `bedrock:ListInferenceProfiles`, and `bedrock:GetInferenceProfile`, along with two `aws-marketplace` subscription actions

68* Limit the role's trust policy to your repository with a subject condition such as `repo:your-org/your-repo:*`. See [GitHub's OIDC hardening guide](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect) for the claim format68> * Limit the role's trust policy to your repository with a subject condition such as `repo:your-org/your-repo:*`. See [GitHub's OIDC hardening guide](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect) for the claim format

69 69>

70Note the role's ARN. You add it as a secret in the next step.70> Note the role's ARN. You add it as a secret in the next step.

71 

72**Google Cloud's Agent Platform**

73 

74Create the federation resources in your Google Cloud project, following the [Workload Identity Federation documentation](https://cloud.google.com/iam/docs/workload-identity-federation):

75 

76* Enable three APIs: IAM Credentials, Security Token Service (STS), and the Agent Platform API, whose service name is `aiplatform.googleapis.com`

77* Create a Workload Identity Pool with a GitHub OIDC provider whose issuer is `https://token.actions.githubusercontent.com`, and add an attribute condition that limits the pool to your repository

78* Create a dedicated service account with only the `Vertex AI User` role, which is `roles/aiplatform.user`, and allow the pool to impersonate it

79 

80Note the provider's full resource name and the service account's email address. You add them as secrets in the next step.

81 

82**Microsoft Foundry**

83 

84Create a Microsoft Entra application with a federated credential for your repository, following [Microsoft's guide to authenticating from GitHub Actions](https://learn.microsoft.com/en-us/azure/developer/github/connect-from-azure-openid-connect):

85 71 

86* Register a Microsoft Entra application and add a federated identity credential that trusts tokens GitHub issues to your repository. A user-assigned managed identity works in place of an application. Both have the client ID you note below72> [tab] Google Cloud's Agent Platform

87* Assign the application the `Azure AI User` role on your Foundry resource. See [Azure RBAC configuration](https://code.claude.com/docs/en/microsoft-foundry.md#azure-rbac-configuration) for a narrower custom role73>

74> Create the federation resources in your Google Cloud project, following the [Workload Identity Federation documentation](https://cloud.google.com/iam/docs/workload-identity-federation):

75>

76> * Enable three APIs: IAM Credentials, Security Token Service (STS), and the Agent Platform API, whose service name is `aiplatform.googleapis.com`

77> * Create a Workload Identity Pool with a GitHub OIDC provider whose issuer is `https://token.actions.githubusercontent.com`, and add an attribute condition that limits the pool to your repository

78> * Create a dedicated service account with only the `Vertex AI User` role, which is `roles/aiplatform.user`, and allow the pool to impersonate it

79>

80> Note the provider's full resource name and the service account's email address. You add them as secrets in the next step.

88 81 

89Note the application's client ID, your tenant ID, and your subscription ID. You add them as secrets in the next step.82> [tab] Microsoft Foundry

83>

84> Create a Microsoft Entra application with a federated credential for your repository, following [Microsoft's guide to authenticating from GitHub Actions](https://learn.microsoft.com/en-us/azure/developer/github/connect-from-azure-openid-connect):

85>

86> * Register a Microsoft Entra application and add a federated identity credential that trusts tokens GitHub issues to your repository. A user-assigned managed identity works in place of an application. Both have the client ID you note below

87> * Assign the application the `Azure AI User` role on your Foundry resource. See [Azure RBAC configuration](https://code.claude.com/docs/en/microsoft-foundry.md#azure-rbac-configuration) for a narrower custom role

88>

89> Note the application's client ID, your tenant ID, and your subscription ID. You add them as secrets in the next step.

90 90 

91**3. Add repository secrets**91**3. Add repository secrets**

92 92 


116>116>

117> On public repositories, a comment containing the trigger phrase from any user starts this workflow. The credential steps run before the Claude Code GitHub Action checks the commenter's write access, so the action rejects unauthorized users only after the workflow has generated an App token and signed in to your cloud provider, which leaves audit-log entries and consumes Actions minutes. To avoid those runs, add a step that verifies the commenter's write access before the credential steps.117> On public repositories, a comment containing the trigger phrase from any user starts this workflow. The credential steps run before the Claude Code GitHub Action checks the commenter's write access, so the action rejects unauthorized users only after the workflow has generated an App token and signed in to your cloud provider, which leaves audit-log entries and consumes Actions minutes. To avoid those runs, add a step that verifies the commenter's write access before the credential steps.

118 118 

119**Amazon Bedrock**119> [tab] Amazon Bedrock

120 120>

121Replace the `aws-region` value with your own. The credentials step exports it as `AWS_REGION` for the rest of the job.121> Replace the `aws-region` value with your own. The credentials step exports it as `AWS_REGION` for the rest of the job.

122 122>

123```yaml theme={null}123> ```yaml theme={null}

124name: Claude PR Action124> name: Claude PR Action

125 125>

126permissions:126> permissions:

127 contents: write127> contents: write

128 pull-requests: write128> pull-requests: write

129 issues: write129> issues: write

130 id-token: write130> id-token: write

131 131>

132on:132> on:

133 issue_comment:133> issue_comment:

134 types: [created]134> types: [created]

135 pull_request_review_comment:135> pull_request_review_comment:

136 types: [created]136> types: [created]

137 issues:137> issues:

138 types: [opened]138> types: [opened]

139 139>

140jobs:140> jobs:

141 claude-pr:141> claude-pr:

142 if: |142> if: |

143 (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||143> (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||

144 (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||144> (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||

145 (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))145> (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))

146 runs-on: ubuntu-latest146> runs-on: ubuntu-latest

147 steps:147> steps:

148 - name: Checkout repository148> - name: Checkout repository

149 uses: actions/checkout@v6149> uses: actions/checkout@v6

150 150>

151 - name: Generate GitHub App token151> - name: Generate GitHub App token

152 id: app-token152> id: app-token

153 uses: actions/create-github-app-token@v2153> uses: actions/create-github-app-token@v2

154 with:154> with:

155 app-id: ${{ secrets.APP_ID }}155> app-id: ${{ secrets.APP_ID }}

156 private-key: ${{ secrets.APP_PRIVATE_KEY }}156> private-key: ${{ secrets.APP_PRIVATE_KEY }}

157 157>

158 - name: Configure AWS Credentials (OIDC)158> - name: Configure AWS Credentials (OIDC)

159 uses: aws-actions/configure-aws-credentials@v4159> uses: aws-actions/configure-aws-credentials@v4

160 with:160> with:

161 role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}161> role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}

162 aws-region: us-west-2162> aws-region: us-west-2

163 163>

164 - uses: anthropics/claude-code-action@v1164> - uses: anthropics/claude-code-action@v1

165 with:165> with:

166 github_token: ${{ steps.app-token.outputs.token }}166> github_token: ${{ steps.app-token.outputs.token }}

167 use_bedrock: "true"167> use_bedrock: "true"

168 claude_args: '--model us.anthropic.claude-sonnet-4-6'168> claude_args: '--model us.anthropic.claude-sonnet-4-6'

169```169> ```

170 170>

171> [!TIP]171> > [!TIP]

172>172> >

173> Bedrock model IDs include a cross-region inference profile prefix such as `us.`. Use the prefix for the region group where you granted model access.173> > Bedrock model IDs include a cross-region inference profile prefix such as `us.`. Use the prefix for the region group where you granted model access.

174 174 

175**Google Cloud's Agent Platform**175> [tab] Google Cloud's Agent Platform

176 176>

177Replace the `CLOUD_ML_REGION` value with your own. You don't need to hardcode the project ID, because the workflow reads it from the `auth` step's output.177> Replace the `CLOUD_ML_REGION` value with your own. You don't need to hardcode the project ID, because the workflow reads it from the `auth` step's output.

178 178>

179```yaml theme={null}179> ```yaml theme={null}

180name: Claude PR Action180> name: Claude PR Action

181 181>

182permissions:182> permissions:

183 contents: write183> contents: write

184 pull-requests: write184> pull-requests: write

185 issues: write185> issues: write

186 id-token: write186> id-token: write

187 187>

188on:188> on:

189 issue_comment:189> issue_comment:

190 types: [created]190> types: [created]

191 pull_request_review_comment:191> pull_request_review_comment:

192 types: [created]192> types: [created]

193 issues:193> issues:

194 types: [opened]194> types: [opened]

195 195>

196jobs:196> jobs:

197 claude-pr:197> claude-pr:

198 if: |198> if: |

199 (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||199> (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||

200 (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||200> (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||

201 (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))201> (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))

202 runs-on: ubuntu-latest202> runs-on: ubuntu-latest

203 steps:203> steps:

204 - name: Checkout repository204> - name: Checkout repository

205 uses: actions/checkout@v6205> uses: actions/checkout@v6

206 206>

207 - name: Generate GitHub App token207> - name: Generate GitHub App token

208 id: app-token208> id: app-token

209 uses: actions/create-github-app-token@v2209> uses: actions/create-github-app-token@v2

210 with:210> with:

211 app-id: ${{ secrets.APP_ID }}211> app-id: ${{ secrets.APP_ID }}

212 private-key: ${{ secrets.APP_PRIVATE_KEY }}212> private-key: ${{ secrets.APP_PRIVATE_KEY }}

213 213>

214 - name: Authenticate to Google Cloud214> - name: Authenticate to Google Cloud

215 id: auth215> id: auth

216 uses: google-github-actions/auth@v2216> uses: google-github-actions/auth@v2

217 with:217> with:

218 workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}218> workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}

219 service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}219> service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}

220 220>

221 - uses: anthropics/claude-code-action@v1221> - uses: anthropics/claude-code-action@v1

222 with:222> with:

223 github_token: ${{ steps.app-token.outputs.token }}223> github_token: ${{ steps.app-token.outputs.token }}

224 use_vertex: "true"224> use_vertex: "true"

225 claude_args: '--model claude-sonnet-5'225> claude_args: '--model claude-sonnet-5'

226 env:226> env:

227 ANTHROPIC_VERTEX_PROJECT_ID: ${{ steps.auth.outputs.project_id }}227> ANTHROPIC_VERTEX_PROJECT_ID: ${{ steps.auth.outputs.project_id }}

228 CLOUD_ML_REGION: us-east5228> CLOUD_ML_REGION: us-east5

229```229> ```

230 230 

231**Microsoft Foundry**231> [tab] Microsoft Foundry

232 232>

233Replace `your-resource-name` with your Foundry resource name. Claude Code builds the endpoint URL from it. The `azure/login` step signs in with the workflow's OIDC token, and Claude Code picks up the credentials through the Azure [default credential chain](https://learn.microsoft.com/en-us/azure/developer/javascript/sdk/authentication/credential-chains#defaultazurecredential-overview).233> Replace `your-resource-name` with your Foundry resource name. Claude Code builds the endpoint URL from it. The `azure/login` step signs in with the workflow's OIDC token, and Claude Code picks up the credentials through the Azure [default credential chain](https://learn.microsoft.com/en-us/azure/developer/javascript/sdk/authentication/credential-chains#defaultazurecredential-overview).

234 234>

235```yaml theme={null}235> ```yaml theme={null}

236name: Claude PR Action236> name: Claude PR Action

237 237>

238permissions:238> permissions:

239 contents: write239> contents: write

240 pull-requests: write240> pull-requests: write

241 issues: write241> issues: write

242 id-token: write242> id-token: write

243 243>

244on:244> on:

245 issue_comment:245> issue_comment:

246 types: [created]246> types: [created]

247 pull_request_review_comment:247> pull_request_review_comment:

248 types: [created]248> types: [created]

249 issues:249> issues:

250 types: [opened]250> types: [opened]

251 251>

252jobs:252> jobs:

253 claude-pr:253> claude-pr:

254 if: |254> if: |

255 (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||255> (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||

256 (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||256> (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||

257 (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))257> (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))

258 runs-on: ubuntu-latest258> runs-on: ubuntu-latest

259 steps:259> steps:

260 - name: Checkout repository260> - name: Checkout repository

261 uses: actions/checkout@v6261> uses: actions/checkout@v6

262 262>

263 - name: Generate GitHub App token263> - name: Generate GitHub App token

264 id: app-token264> id: app-token

265 uses: actions/create-github-app-token@v2265> uses: actions/create-github-app-token@v2

266 with:266> with:

267 app-id: ${{ secrets.APP_ID }}267> app-id: ${{ secrets.APP_ID }}

268 private-key: ${{ secrets.APP_PRIVATE_KEY }}268> private-key: ${{ secrets.APP_PRIVATE_KEY }}

269 269>

270 - name: Authenticate to Azure270> - name: Authenticate to Azure

271 uses: azure/login@v2271> uses: azure/login@v2

272 with:272> with:

273 client-id: ${{ secrets.AZURE_CLIENT_ID }}273> client-id: ${{ secrets.AZURE_CLIENT_ID }}

274 tenant-id: ${{ secrets.AZURE_TENANT_ID }}274> tenant-id: ${{ secrets.AZURE_TENANT_ID }}

275 subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}275> subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

276 276>

277 - uses: anthropics/claude-code-action@v1277> - uses: anthropics/claude-code-action@v1

278 with:278> with:

279 github_token: ${{ steps.app-token.outputs.token }}279> github_token: ${{ steps.app-token.outputs.token }}

280 use_foundry: "true"280> use_foundry: "true"

281 claude_args: '--model claude-sonnet-5'281> claude_args: '--model claude-sonnet-5'

282 env:282> env:

283 ANTHROPIC_FOUNDRY_RESOURCE: your-resource-name283> ANTHROPIC_FOUNDRY_RESOURCE: your-resource-name

284```284> ```

285 285>

286> [!TIP]286> > [!TIP]

287>287> >

288> Use a model ID that matches a Claude deployment in your Foundry resource. See [Claude Code on Microsoft Foundry](https://code.claude.com/docs/en/microsoft-foundry.md) for model configuration and version pinning.288> > Use a model ID that matches a Claude deployment in your Foundry resource. See [Claude Code on Microsoft Foundry](https://code.claude.com/docs/en/microsoft-foundry.md) for model configuration and version pinning.

289 289 

290With any provider, you can bound run length and cost by adding `--max-turns` to `claude_args`. See [Manage costs](https://code.claude.com/docs/en/github-actions.md#manage-costs).290With any provider, you can bound run length and cost by adding `--max-turns` to `claude_args`. See [Manage costs](https://code.claude.com/docs/en/github-actions.md#manage-costs).

291 291 

gitlab-ci-cd.md +52 −52

Details

158 158 

159For enterprise environments, you can run Claude Code entirely on your cloud infrastructure with the same developer experience.159For enterprise environments, you can run Claude Code entirely on your cloud infrastructure with the same developer experience.

160 160 

161**Amazon Bedrock**161> [tab] Amazon Bedrock

162 162>

163### Prerequisites163> ### Prerequisites

164 164>

165Before setting up Claude Code with Amazon Bedrock, you need:165> Before setting up Claude Code with Amazon Bedrock, you need:

166 166>

1671. An AWS account with Amazon Bedrock access to the desired Claude models167> 1. An AWS account with Amazon Bedrock access to the desired Claude models

1682. GitLab configured as an OIDC identity provider in AWS IAM168> 2. GitLab configured as an OIDC identity provider in AWS IAM

1693. An IAM role with Amazon Bedrock permissions and a trust policy restricted to your GitLab project/refs169> 3. An IAM role with Amazon Bedrock permissions and a trust policy restricted to your GitLab project/refs

1704. GitLab CI/CD variables for role assumption:170> 4. GitLab CI/CD variables for role assumption:

171 * `AWS_ROLE_TO_ASSUME` (role ARN)171> * `AWS_ROLE_TO_ASSUME` (role ARN)

172 * `AWS_REGION` (Amazon Bedrock region)172> * `AWS_REGION` (Amazon Bedrock region)

173 173>

174### Setup instructions174> ### Setup instructions

175 175>

176Configure AWS to allow GitLab CI jobs to assume an IAM role via OIDC (no static keys).176> Configure AWS to allow GitLab CI jobs to assume an IAM role via OIDC (no static keys).

177 177>

178**Required setup:**178> **Required setup:**

179 179>

1801. Enable Amazon Bedrock and request access to your target Claude models180> 1. Enable Amazon Bedrock and request access to your target Claude models

1812. Create an IAM OIDC provider for GitLab if not already present181> 2. Create an IAM OIDC provider for GitLab if not already present

1823. Create an IAM role trusted by the GitLab OIDC provider, restricted to your project and protected refs182> 3. Create an IAM role trusted by the GitLab OIDC provider, restricted to your project and protected refs

1834. Attach least-privilege permissions for Amazon Bedrock invoke APIs183> 4. Attach least-privilege permissions for Amazon Bedrock invoke APIs

184 184>

185Use the [Amazon Bedrock job example](#configuration-examples) to exchange the job's OIDC token for temporary AWS credentials at runtime.185> Use the [Amazon Bedrock job example](#configuration-examples) to exchange the job's OIDC token for temporary AWS credentials at runtime.

186 

187**Google Cloud's Agent Platform**

188 

189### Prerequisites

190 

191Before setting up Claude Code with Google Cloud's Agent Platform, you need:

192 

1931. A Google Cloud project with:

194 * Google Cloud's Agent Platform API enabled

195 * Workload Identity Federation configured to trust GitLab OIDC

1962. A dedicated service account with only the required Google Cloud's Agent Platform roles

1973. GitLab CI/CD variables:

198 * `GCP_WORKLOAD_IDENTITY_PROVIDER` (provider resource name without the `//iam.googleapis.com/` prefix, such as `projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider`)

199 * `GCP_SERVICE_ACCOUNT` (service account email)

200 * `GCP_PROJECT_ID` (Google Cloud project ID)

201 

202### Setup instructions

203 

204Configure Google Cloud to allow GitLab CI jobs to impersonate a service account via Workload Identity Federation.

205 

206**Required setup:**

207 

2081. Enable IAM Credentials API, STS API, and Google Cloud's Agent Platform API

2092. Create a Workload Identity Pool and provider for GitLab OIDC

2103. Create a dedicated service account with Google Cloud's Agent Platform roles

2114. Grant the WIF principal permission to impersonate the service account

212 186 

213Use the [Agent Platform job example](#configuration-examples) to authenticate without storing keys.187> [tab] Google Cloud's Agent Platform

188>

189> ### Prerequisites

190>

191> Before setting up Claude Code with Google Cloud's Agent Platform, you need:

192>

193> 1. A Google Cloud project with:

194> * Google Cloud's Agent Platform API enabled

195> * Workload Identity Federation configured to trust GitLab OIDC

196> 2. A dedicated service account with only the required Google Cloud's Agent Platform roles

197> 3. GitLab CI/CD variables:

198> * `GCP_WORKLOAD_IDENTITY_PROVIDER` (provider resource name without the `//iam.googleapis.com/` prefix, such as `projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider`)

199> * `GCP_SERVICE_ACCOUNT` (service account email)

200> * `GCP_PROJECT_ID` (Google Cloud project ID)

201>

202> ### Setup instructions

203>

204> Configure Google Cloud to allow GitLab CI jobs to impersonate a service account via Workload Identity Federation.

205>

206> **Required setup:**

207>

208> 1. Enable IAM Credentials API, STS API, and Google Cloud's Agent Platform API

209> 2. Create a Workload Identity Pool and provider for GitLab OIDC

210> 3. Create a dedicated service account with Google Cloud's Agent Platform roles

211> 4. Grant the WIF principal permission to impersonate the service account

212>

213> Use the [Agent Platform job example](#configuration-examples) to authenticate without storing keys.

214 214 

215## Configuration examples215## Configuration examples

216 216 

glossary.md +5 −2

Details

54 54 

55### Auto mode55### Auto mode

56 56 

57A [permission mode](#permission-mode) where a separate classifier model reviews actions instead of you, so Claude Code runs most of them without asking you. Claude Code still asks you before actions your explicit ask rules match. With Claude Code v2.1.283 or later, auto mode is the [built-in starting permission mode](https://code.claude.com/docs/en/permission-modes.md#which-mode-a-session-starts-in) for interactive terminal and VS Code sessions, and on earlier versions only on Pro, Max, and Team plans. The classifier blocks scope escalation, untrusted infrastructure, and [prompt injection](#prompt-injection). Tool results are stripped from what it sees, so hostile content in a file or web page can't manipulate it directly.57A [permission mode](#permission-mode) where a separate classifier model reviews actions instead of you, so Claude Code runs most of them without asking you. Claude Code still asks you before actions your explicit ask rules match. The classifier blocks scope escalation, untrusted infrastructure, and [prompt injection](#prompt-injection). Tool results are stripped from what it sees, so hostile content in a file or web page can't manipulate it directly.

58 

59* **Claude Code v2.1.283 or later**: auto mode is the [built-in starting permission mode](https://code.claude.com/docs/en/permission-modes.md#which-mode-a-session-starts-in) for interactive terminal and VS Code sessions

60* **Earlier versions**: auto mode is the built-in starting permission mode only on Pro, Max, Ultra, and Team plans

58 61 

59Learn more: [Eliminate prompts with auto mode](https://code.claude.com/docs/en/permission-modes.md#eliminate-prompts-with-auto-mode)62Learn more: [Eliminate prompts with auto mode](https://code.claude.com/docs/en/permission-modes.md#eliminate-prompts-with-auto-mode)

60 63 


140 143 

141### Dispatch144### Dispatch

142 145 

143A phone-initiated task router that spawns a Claude Code session in the Desktop app when you send a coding task from the Claude mobile app. Your prompt routes to the right tool automatically. Available on Pro and Max plans.146A phone-initiated task router that spawns a Claude Code session in the Desktop app when you send a coding task from the Claude mobile app. Your prompt routes to the right tool automatically. Available on Pro, Max, and Ultra plans.

144 147 

145Learn more: [Sessions from Dispatch](https://code.claude.com/docs/en/desktop.md#sessions-from-dispatch)148Learn more: [Sessions from Dispatch](https://code.claude.com/docs/en/desktop.md#sessions-from-dispatch)

146 149 

hooks.md +411 −411

Details

68 68 

69To see how the event, the matcher, and the handler fit together, consider this `PreToolUse` hook that blocks destructive shell commands.69To see how the event, the matcher, and the handler fit together, consider this `PreToolUse` hook that blocks destructive shell commands.

70 70 

71**macOS/Linux**71> [tab] macOS/Linux

72 72>

73The `matcher` narrows to Bash tool calls and the `if` condition narrows further to Bash subcommands matching `rm *`, so `block-rm.sh` only spawns when both filters match:73> The `matcher` narrows to Bash tool calls and the `if` condition narrows further to Bash subcommands matching `rm *`, so `block-rm.sh` only spawns when both filters match:

74 74>

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

76{76> {

77 "hooks": {77> "hooks": {

78 "PreToolUse": [78> "PreToolUse": [

79 {79> {

80 "matcher": "Bash",80> "matcher": "Bash",

81 "hooks": [81> "hooks": [

82 {82> {

83 "type": "command",83> "type": "command",

84 "if": "Bash(rm *)",84> "if": "Bash(rm *)",

85 "command": "${CLAUDE_PROJECT_DIR}/.claude/hooks/block-rm.sh",85> "command": "${CLAUDE_PROJECT_DIR}/.claude/hooks/block-rm.sh",

86 "args": []86> "args": []

87 }87> }

88 ]88> ]

89 }89> }

90 ]90> ]

91 }91> }

92}92> }

93```93> ```

94 94>

95The script reads the JSON input from stdin, extracts the command, and returns a `permissionDecision` of `"deny"` if it contains `rm -rf`. Save it to `.claude/hooks/block-rm.sh` in your project and make it executable with `chmod +x .claude/hooks/block-rm.sh` so Claude Code can run it:95> The script reads the JSON input from stdin, extracts the command, and returns a `permissionDecision` of `"deny"` if it contains `rm -rf`. Save it to `.claude/hooks/block-rm.sh` in your project and make it executable with `chmod +x .claude/hooks/block-rm.sh` so Claude Code can run it:

96 96>

97```bash theme={null}97> ```bash theme={null}

98#!/bin/bash98> #!/bin/bash

99# .claude/hooks/block-rm.sh99> # .claude/hooks/block-rm.sh

100COMMAND=$(jq -r '.tool_input.command')100> COMMAND=$(jq -r '.tool_input.command')

101 101>

102if echo "$COMMAND" | grep -q 'rm -rf'; then102> if echo "$COMMAND" | grep -q 'rm -rf'; then

103 jq -n '{103> jq -n '{

104 hookSpecificOutput: {104> hookSpecificOutput: {

105 hookEventName: "PreToolUse",105> hookEventName: "PreToolUse",

106 permissionDecision: "deny",106> permissionDecision: "deny",

107 permissionDecisionReason: "Destructive command blocked by hook"107> permissionDecisionReason: "Destructive command blocked by hook"

108 }108> }

109 }'109> }'

110else110> else

111 exit 0 # no decision; normal permission flow applies111> exit 0 # no decision; normal permission flow applies

112fi112> fi

113```113> ```

114 114>

115This script, like the other Bash examples on this page that parse JSON input, uses `jq`, so install `jq` and make sure it is on your `PATH` before trying them.115> This script, like the other Bash examples on this page that parse JSON input, uses `jq`, so install `jq` and make sure it is on your `PATH` before trying them.

116 

117**Windows (PowerShell)**

118 

119The matcher `Bash|PowerShell` covers the [PowerShell tool](#powershell) as well as Bash. A single `if` rule matches only one tool's calls, so each tool gets its own handler: the first narrows to Bash subcommands matching `rm *`, the second to PowerShell commands matching `Remove-Item *`. Both run the same script through `powershell.exe`:

120 

121```json theme={null}

122{

123 "hooks": {

124 "PreToolUse": [

125 {

126 "matcher": "Bash|PowerShell",

127 "hooks": [

128 {

129 "type": "command",

130 "if": "Bash(rm *)",

131 "command": "powershell.exe",

132 "args": [

133 "-NoProfile",

134 "-ExecutionPolicy",

135 "Bypass",

136 "-File",

137 "${CLAUDE_PROJECT_DIR}/.claude/hooks/block-rm.ps1"

138 ]

139 },

140 {

141 "type": "command",

142 "if": "PowerShell(Remove-Item *)",

143 "command": "powershell.exe",

144 "args": [

145 "-NoProfile",

146 "-ExecutionPolicy",

147 "Bypass",

148 "-File",

149 "${CLAUDE_PROJECT_DIR}/.claude/hooks/block-rm.ps1"

150 ]

151 }

152 ]

153 }

154 ]

155 }

156}

157```

158 

159The `-NoProfile` flag skips loading your PowerShell profile so the hook starts fast, and `-ExecutionPolicy Bypass` lets PowerShell run the local script file.

160 

161The script reads the JSON input from stdin, extracts the command, and returns a `permissionDecision` of `"deny"` if it contains `rm -rf` or `Remove-Item` followed by `-Recurse`. Save it to `.claude/hooks/block-rm.ps1` in your project:

162 

163```powershell theme={null}

164# .claude/hooks/block-rm.ps1

165$callInput = [Console]::In.ReadToEnd() | ConvertFrom-Json

166$command = $callInput.tool_input.command

167 116 

168if ($command -match 'rm -rf|Remove-Item.*-Recurse') {117> [tab] Windows (PowerShell)

169 @{118>

170 hookSpecificOutput = @{119> The matcher `Bash|PowerShell` covers the [PowerShell tool](#powershell) as well as Bash. A single `if` rule matches only one tool's calls, so each tool gets its own handler: the first narrows to Bash subcommands matching `rm *`, the second to PowerShell commands matching `Remove-Item *`. Both run the same script through `powershell.exe`:

171 hookEventName = "PreToolUse"120>

172 permissionDecision = "deny"121> ```json theme={null}

173 permissionDecisionReason = "Destructive command blocked by hook"122> {

174 }123> "hooks": {

175 } | ConvertTo-Json124> "PreToolUse": [

176} else {125> {

177 exit 0 # no decision; normal permission flow applies126> "matcher": "Bash|PowerShell",

178}127> "hooks": [

179```128> {

129> "type": "command",

130> "if": "Bash(rm *)",

131> "command": "powershell.exe",

132> "args": [

133> "-NoProfile",

134> "-ExecutionPolicy",

135> "Bypass",

136> "-File",

137> "${CLAUDE_PROJECT_DIR}/.claude/hooks/block-rm.ps1"

138> ]

139> },

140> {

141> "type": "command",

142> "if": "PowerShell(Remove-Item *)",

143> "command": "powershell.exe",

144> "args": [

145> "-NoProfile",

146> "-ExecutionPolicy",

147> "Bypass",

148> "-File",

149> "${CLAUDE_PROJECT_DIR}/.claude/hooks/block-rm.ps1"

150> ]

151> }

152> ]

153> }

154> ]

155> }

156> }

157> ```

158>

159> The `-NoProfile` flag skips loading your PowerShell profile so the hook starts fast, and `-ExecutionPolicy Bypass` lets PowerShell run the local script file.

160>

161> The script reads the JSON input from stdin, extracts the command, and returns a `permissionDecision` of `"deny"` if it contains `rm -rf` or `Remove-Item` followed by `-Recurse`. Save it to `.claude/hooks/block-rm.ps1` in your project:

162>

163> ```powershell theme={null}

164> # .claude/hooks/block-rm.ps1

165> $callInput = [Console]::In.ReadToEnd() | ConvertFrom-Json

166> $command = $callInput.tool_input.command

167>

168> if ($command -match 'rm -rf|Remove-Item.*-Recurse') {

169> @{

170> hookSpecificOutput = @{

171> hookEventName = "PreToolUse"

172> permissionDecision = "deny"

173> permissionDecisionReason = "Destructive command blocked by hook"

174> }

175> } | ConvertTo-Json

176> } else {

177> exit 0 # no decision; normal permission flow applies

178> }

179> ```

180 180 

181Now suppose Claude Code decides to run `Bash "rm -rf /tmp/build"` against the macOS/Linux config. Here's what happens:181Now suppose Claude Code decides to run `Bash "rm -rf /tmp/build"` against the macOS/Linux config. Here's what happens:

182 182 


601 601 

602Prefer [exec form](#exec-form-and-shell-form) for any hook that references a path placeholder. In shell form, wrap each placeholder in double quotes.602Prefer [exec form](#exec-form-and-shell-form) for any hook that references a path placeholder. In shell form, wrap each placeholder in double quotes.

603 603 

604**Project scripts**604> [tab] Project scripts

605 605>

606This example uses `${CLAUDE_PROJECT_DIR}` to run a style checker from the project's `.claude/hooks/` directory after any `Write` or `Edit` tool call:606> This example uses `${CLAUDE_PROJECT_DIR}` to run a style checker from the project's `.claude/hooks/` directory after any `Write` or `Edit` tool call:

607 607>

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

609{609> {

610 "hooks": {610> "hooks": {

611 "PostToolUse": [611> "PostToolUse": [

612 {612> {

613 "matcher": "Write|Edit",613> "matcher": "Write|Edit",

614 "hooks": [614> "hooks": [

615 {615> {

616 "type": "command",616> "type": "command",

617 "command": "${CLAUDE_PROJECT_DIR}/.claude/hooks/check-style.sh",617> "command": "${CLAUDE_PROJECT_DIR}/.claude/hooks/check-style.sh",

618 "args": []618> "args": []

619 }619> }

620 ]620> ]

621 }621> }

622 ]622> ]

623 }623> }

624}624> }

625```625> ```

626 626 

627**Plugin scripts**627> [tab] Plugin scripts

628 628>

629Define plugin hooks in `hooks/hooks.json` with an optional top-level `description` field. When a plugin is enabled, its hooks merge with your user and project hooks.629> Define plugin hooks in `hooks/hooks.json` with an optional top-level `description` field. When a plugin is enabled, its hooks merge with your user and project hooks.

630 630>

631This example runs a formatting script bundled with the plugin:631> This example runs a formatting script bundled with the plugin:

632 632>

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

634{634> {

635 "description": "Automatic code formatting",635> "description": "Automatic code formatting",

636 "hooks": {636> "hooks": {

637 "PostToolUse": [637> "PostToolUse": [

638 {638> {

639 "matcher": "Write|Edit",639> "matcher": "Write|Edit",

640 "hooks": [640> "hooks": [

641 {641> {

642 "type": "command",642> "type": "command",

643 "command": "${CLAUDE_PLUGIN_ROOT}/scripts/format.sh",643> "command": "${CLAUDE_PLUGIN_ROOT}/scripts/format.sh",

644 "args": [],644> "args": [],

645 "timeout": 30645> "timeout": 30

646 }646> }

647 ]647> ]

648 }648> }

649 ]649> ]

650 }650> }

651}651> }

652```652> ```

653 653>

654See the [plugin components reference](https://code.claude.com/docs/en/plugins/components.md#hooks) for details on creating plugin hooks.654> See the [plugin components reference](https://code.claude.com/docs/en/plugins/components.md#hooks) for details on creating plugin hooks.

655 655 

656### Hooks in skills and agents656### Hooks in skills and agents

657 657 


1180 1180 

1181Here are examples of each pattern in action:1181Here are examples of each pattern in action:

1182 1182 

1183**Top-level decision**1183> [tab] Top-level decision

1184 1184>

1185The only value for `decision` is `"block"`. To allow the action to proceed, omit `decision` from your JSON, or exit 0 without any JSON at all:1185> The only value for `decision` is `"block"`. To allow the action to proceed, omit `decision` from your JSON, or exit 0 without any JSON at all:

1186 1186>

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

1188{1188> {

1189 "decision": "block",1189> "decision": "block",

1190 "reason": "Test suite must pass before proceeding"1190> "reason": "Test suite must pass before proceeding"

1191}1191> }

1192```1192> ```

1193 1193 

1194**PreToolUse**1194> [tab] PreToolUse

1195 1195>

1196Uses `hookSpecificOutput` for richer control: allow, deny, or escalate to the user. You can also modify tool input before it runs or inject additional context for Claude. See [PreToolUse decision control](#pretooluse-decision-control) for the full set of options.1196> Uses `hookSpecificOutput` for richer control: allow, deny, or escalate to the user. You can also modify tool input before it runs or inject additional context for Claude. See [PreToolUse decision control](#pretooluse-decision-control) for the full set of options.

1197 1197>

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

1199{1199> {

1200 "hookSpecificOutput": {1200> "hookSpecificOutput": {

1201 "hookEventName": "PreToolUse",1201> "hookEventName": "PreToolUse",

1202 "permissionDecision": "deny",1202> "permissionDecision": "deny",

1203 "permissionDecisionReason": "Database writes are not allowed"1203> "permissionDecisionReason": "Database writes are not allowed"

1204 }1204> }

1205}1205> }

1206```1206> ```

1207 1207 

1208**PermissionRequest**1208> [tab] PermissionRequest

1209 1209>

1210Uses `hookSpecificOutput` to allow or deny a permission request on behalf of the user. When allowing, you can also modify the tool's input or apply permission rules so the user isn't prompted again. See [PermissionRequest decision control](#permissionrequest-decision-control) for the full set of options.1210> Uses `hookSpecificOutput` to allow or deny a permission request on behalf of the user. When allowing, you can also modify the tool's input or apply permission rules so the user isn't prompted again. See [PermissionRequest decision control](#permissionrequest-decision-control) for the full set of options.

1211 1211>

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

1213{1213> {

1214 "hookSpecificOutput": {1214> "hookSpecificOutput": {

1215 "hookEventName": "PermissionRequest",1215> "hookEventName": "PermissionRequest",

1216 "decision": {1216> "decision": {

1217 "behavior": "allow",1217> "behavior": "allow",

1218 "updatedInput": {1218> "updatedInput": {

1219 "command": "npm run lint"1219> "command": "npm run lint"

1220 }1220> }

1221 }1221> }

1222 }1222> }

1223}1223> }

1224```1224> ```

1225 1225 

1226For extended examples including Bash command validation, prompt filtering, and auto-approval scripts, see [What you can automate](https://code.claude.com/docs/en/hooks-guide.md#what-you-can-automate) in the guide and the [Bash command validator reference implementation](https://github.com/anthropics/claude-code/blob/main/examples/hooks/bash_command_validator_example.py).1226For extended examples including Bash command validation, prompt filtering, and auto-approval scripts, see [What you can automate](https://code.claude.com/docs/en/hooks-guide.md#what-you-can-automate) in the guide and the [Bash command validator reference implementation](https://github.com/anthropics/claude-code/blob/main/examples/hooks/bash_command_validator_example.py).

1227 1227 


1656 1656 

1657This example strips markdown formatting from Claude's responses for a plain-text display. The script reads each batch from stdin, removes bold markers and inline code backticks from `delta`, and returns the result as `displayContent`.1657This example strips markdown formatting from Claude's responses for a plain-text display. The script reads each batch from stdin, removes bold markers and inline code backticks from `delta`, and returns the result as `displayContent`.

1658 1658 

1659**macOS/Linux**1659> [tab] macOS/Linux

1660 1660>

1661Register a command hook for the event in your settings file:1661> Register a command hook for the event in your settings file:

1662 1662>

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

1664{1664> {

1665 "hooks": {1665> "hooks": {

1666 "MessageDisplay": [1666> "MessageDisplay": [

1667 {1667> {

1668 "hooks": [1668> "hooks": [

1669 {1669> {

1670 "type": "command",1670> "type": "command",

1671 "command": "${CLAUDE_PROJECT_DIR}/.claude/hooks/plain-display.sh",1671> "command": "${CLAUDE_PROJECT_DIR}/.claude/hooks/plain-display.sh",

1672 "args": []1672> "args": []

1673 }1673> }

1674 ]1674> ]

1675 }1675> }

1676 ]1676> ]

1677 }1677> }

1678}1678> }

1679```1679> ```

1680 1680>

1681Save this script to `.claude/hooks/plain-display.sh` in your project and make it executable with `chmod +x`:1681> Save this script to `.claude/hooks/plain-display.sh` in your project and make it executable with `chmod +x`:

1682 1682>

1683```bash theme={null}1683> ```bash theme={null}

1684#!/bin/bash1684> #!/bin/bash

1685jq '{hookSpecificOutput: {hookEventName: "MessageDisplay", displayContent: (.delta | gsub("\\*\\*"; "") | gsub("`"; ""))}}'1685> jq '{hookSpecificOutput: {hookEventName: "MessageDisplay", displayContent: (.delta | gsub("\\*\\*"; "") | gsub("`"; ""))}}'

1686```1686> ```

1687 

1688**Windows (PowerShell)**

1689 

1690Register a command hook that runs the script through PowerShell:

1691 

1692```json theme={null}

1693{

1694 "hooks": {

1695 "MessageDisplay": [

1696 {

1697 "hooks": [

1698 {

1699 "type": "command",

1700 "command": "powershell.exe",

1701 "args": [

1702 "-NoProfile",

1703 "-ExecutionPolicy",

1704 "Bypass",

1705 "-File",

1706 "${CLAUDE_PROJECT_DIR}/.claude/hooks/plain-display.ps1"

1707 ]

1708 }

1709 ]

1710 }

1711 ]

1712 }

1713}

1714```

1715 

1716The `-NoProfile` flag skips loading your PowerShell profile so the hook starts fast, and `-ExecutionPolicy Bypass` lets PowerShell run the local script file.

1717 

1718Save this script to `.claude/hooks/plain-display.ps1` in your project:

1719 1687 

1720```powershell theme={null}1688> [tab] Windows (PowerShell)

1721$batch = [Console]::In.ReadToEnd() | ConvertFrom-Json1689>

1722$text = $batch.delta -replace '\*\*', '' -replace '`', ''1690> Register a command hook that runs the script through PowerShell:

1723@{1691>

1724 hookSpecificOutput = @{1692> ```json theme={null}

1725 hookEventName = "MessageDisplay"1693> {

1726 displayContent = $text1694> "hooks": {

1727 }1695> "MessageDisplay": [

1728} | ConvertTo-Json1696> {

1729```1697> "hooks": [

1698> {

1699> "type": "command",

1700> "command": "powershell.exe",

1701> "args": [

1702> "-NoProfile",

1703> "-ExecutionPolicy",

1704> "Bypass",

1705> "-File",

1706> "${CLAUDE_PROJECT_DIR}/.claude/hooks/plain-display.ps1"

1707> ]

1708> }

1709> ]

1710> }

1711> ]

1712> }

1713> }

1714> ```

1715>

1716> The `-NoProfile` flag skips loading your PowerShell profile so the hook starts fast, and `-ExecutionPolicy Bypass` lets PowerShell run the local script file.

1717>

1718> Save this script to `.claude/hooks/plain-display.ps1` in your project:

1719>

1720> ```powershell theme={null}

1721> $batch = [Console]::In.ReadToEnd() | ConvertFrom-Json

1722> $text = $batch.delta -replace '\*\*', '' -replace '`', ''

1723> @{

1724> hookSpecificOutput = @{

1725> hookEventName = "MessageDisplay"

1726> displayContent = $text

1727> }

1728> } | ConvertTo-Json

1729> ```

1730 1730 

1731Batches with no markdown pass through unchanged. If the script fails, for example because `jq` is missing, Claude Code displays the original text and notes the failure only in [debug output](#debug-hooks), not in the session.1731Batches with no markdown pass through unchanged. If the script fails, for example because `jq` is missing, Claude Code displays the original text and notes the failure only in [debug output](#debug-hooks), not in the session.

1732 1732 


3357 3357 

3358Write the matcher as an exact name, a `|`-separated list such as `claude-opus-4-6|claude-opus-5`, or a regular expression such as `.*opus.*`. This example uses an exact-name matcher and also checks `to_model` from the hook input, so it refuses a switch to Opus 4.6 by exiting with code 2 and lets any other target through:3358Write the matcher as an exact name, a `|`-separated list such as `claude-opus-4-6|claude-opus-5`, or a regular expression such as `.*opus.*`. This example uses an exact-name matcher and also checks `to_model` from the hook input, so it refuses a switch to Opus 4.6 by exiting with code 2 and lets any other target through:

3359 3359 

3360**macOS/Linux**3360> [tab] macOS/Linux

3361 3361>

3362The command checks `to_model` with `jq`:3362> The command checks `to_model` with `jq`:

3363 3363>

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

3365{3365> {

3366 "hooks": {3366> "hooks": {

3367 "PreModelSwitch": [3367> "PreModelSwitch": [

3368 {3368> {

3369 "matcher": "claude-opus-4-6",3369> "matcher": "claude-opus-4-6",

3370 "hooks": [3370> "hooks": [

3371 {3371> {

3372 "type": "command",3372> "type": "command",

3373 "command": "jq -e '.to_model | test(\"opus-4-6\")' > /dev/null && { echo 'Opus 4.6 is retired for this project. Use a newer model.' >&2; exit 2; }; exit 0"3373> "command": "jq -e '.to_model | test(\"opus-4-6\")' > /dev/null && { echo 'Opus 4.6 is retired for this project. Use a newer model.' >&2; exit 2; }; exit 0"

3374 }3374> }

3375 ]3375> ]

3376 }3376> }

3377 ]3377> ]

3378 }3378> }

3379}3379> }

3380```3380> ```

3381 3381 

3382**Windows (PowerShell)**3382> [tab] Windows (PowerShell)

3383 3383>

3384Register a command hook that runs a script through PowerShell:3384> Register a command hook that runs a script through PowerShell:

3385 3385>

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

3387{3387> {

3388 "hooks": {3388> "hooks": {

3389 "PreModelSwitch": [3389> "PreModelSwitch": [

3390 {3390> {

3391 "matcher": "claude-opus-4-6",3391> "matcher": "claude-opus-4-6",

3392 "hooks": [3392> "hooks": [

3393 {3393> {

3394 "type": "command",3394> "type": "command",

3395 "command": "powershell.exe",3395> "command": "powershell.exe",

3396 "args": [3396> "args": [

3397 "-NoProfile",3397> "-NoProfile",

3398 "-ExecutionPolicy",3398> "-ExecutionPolicy",

3399 "Bypass",3399> "Bypass",

3400 "-File",3400> "-File",

3401 "${CLAUDE_PROJECT_DIR}/.claude/hooks/block-opus-46.ps1"3401> "${CLAUDE_PROJECT_DIR}/.claude/hooks/block-opus-46.ps1"

3402 ]3402> ]

3403 }3403> }

3404 ]3404> ]

3405 }3405> }

3406 ]3406> ]

3407 }3407> }

3408}3408> }

3409```3409> ```

3410 3410>

3411Save this script to `.claude/hooks/block-opus-46.ps1` in your project:3411> Save this script to `.claude/hooks/block-opus-46.ps1` in your project:

3412 3412>

3413```powershell theme={null}3413> ```powershell theme={null}

3414$hookInput = [Console]::In.ReadToEnd() | ConvertFrom-Json3414> $hookInput = [Console]::In.ReadToEnd() | ConvertFrom-Json

3415if ($hookInput.to_model -match 'opus-4-6') {3415> if ($hookInput.to_model -match 'opus-4-6') {

3416 [Console]::Error.WriteLine('Opus 4.6 is retired for this project. Use a newer model.')3416> [Console]::Error.WriteLine('Opus 4.6 is retired for this project. Use a newer model.')

3417 exit 23417> exit 2

3418}3418> }

3419exit 03419> exit 0

3420```3420> ```

3421 3421 

3422To confirm the hook works, run `/model claude-opus-4-6` from a session running a different model. Claude Code keeps the current model and reports that a PreModelSwitch hook blocked the switch, with your message as the reason.3422To confirm the hook works, run `/model claude-opus-4-6` from a session running a different model. Claude Code keeps the current model and reports that a PreModelSwitch hook blocked the switch, with your message as the reason.

3423 3423 


3705 3705 

3706This example answers one recurring question for the user. An MCP server named `issue-tracker` asks for a project key in a form, and the hook fills in `DOCS`. The script accepts when `project_key` is the form's single field. For any other request it prints nothing, so the dialog appears.3706This example answers one recurring question for the user. An MCP server named `issue-tracker` asks for a project key in a form, and the hook fills in `DOCS`. The script accepts when `project_key` is the form's single field. For any other request it prints nothing, so the dialog appears.

3707 3707 

3708**macOS/Linux**3708> [tab] macOS/Linux

3709 3709>

3710Register a command hook for the event in your settings file, with the server name as the matcher:3710> Register a command hook for the event in your settings file, with the server name as the matcher:

3711 3711>

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

3713{3713> {

3714 "hooks": {3714> "hooks": {

3715 "Elicitation": [3715> "Elicitation": [

3716 {3716> {

3717 "matcher": "issue-tracker",3717> "matcher": "issue-tracker",

3718 "hooks": [3718> "hooks": [

3719 {3719> {

3720 "type": "command",3720> "type": "command",

3721 "command": "${CLAUDE_PROJECT_DIR}/.claude/hooks/answer-project-key.sh",3721> "command": "${CLAUDE_PROJECT_DIR}/.claude/hooks/answer-project-key.sh",

3722 "args": []3722> "args": []

3723 }3723> }

3724 ]3724> ]

3725 }3725> }

3726 ]3726> ]

3727 }3727> }

3728}3728> }

3729```3729> ```

3730 3730>

3731Save this script to `.claude/hooks/answer-project-key.sh` in your project and make it executable with `chmod +x`:3731> Save this script to `.claude/hooks/answer-project-key.sh` in your project and make it executable with `chmod +x`:

3732 3732>

3733```bash theme={null}3733> ```bash theme={null}

3734#!/bin/bash3734> #!/bin/bash

3735input=$(cat)3735> input=$(cat)

3736fields=$(jq -c '.requested_schema.properties // {} | keys' <<<"$input")3736> fields=$(jq -c '.requested_schema.properties // {} | keys' <<<"$input")

3737 3737>

3738if [ "$fields" = '["project_key"]' ]; then3738> if [ "$fields" = '["project_key"]' ]; then

3739 jq -n '{hookSpecificOutput: {hookEventName: "Elicitation", action: "accept", content: {project_key: "DOCS"}}}'3739> jq -n '{hookSpecificOutput: {hookEventName: "Elicitation", action: "accept", content: {project_key: "DOCS"}}}'

3740fi3740> fi

3741```3741> ```

3742 

3743**Windows (PowerShell)**

3744 

3745Register a command hook that runs the script through PowerShell, with the server name as the matcher:

3746 

3747```json theme={null}

3748{

3749 "hooks": {

3750 "Elicitation": [

3751 {

3752 "matcher": "issue-tracker",

3753 "hooks": [

3754 {

3755 "type": "command",

3756 "command": "powershell.exe",

3757 "args": [

3758 "-NoProfile",

3759 "-ExecutionPolicy",

3760 "Bypass",

3761 "-File",

3762 "${CLAUDE_PROJECT_DIR}/.claude/hooks/answer-project-key.ps1"

3763 ]

3764 }

3765 ]

3766 }

3767 ]

3768 }

3769}

3770```

3771 

3772Save this script to `.claude/hooks/answer-project-key.ps1` in your project:

3773 

3774```powershell theme={null}

3775$request = [Console]::In.ReadToEnd() | ConvertFrom-Json

3776$fields = @($request.requested_schema.properties.PSObject.Properties.Name)

3777 3742 

3778if ($fields.Count -eq 1 -and $fields[0] -eq 'project_key') {3743> [tab] Windows (PowerShell)

3779 @{3744>

3780 hookSpecificOutput = @{3745> Register a command hook that runs the script through PowerShell, with the server name as the matcher:

3781 hookEventName = "Elicitation"3746>

3782 action = "accept"3747> ```json theme={null}

3783 content = @{ project_key = "DOCS" }3748> {

3784 }3749> "hooks": {

3785 } | ConvertTo-Json -Depth 33750> "Elicitation": [

3786}3751> {

3787```3752> "matcher": "issue-tracker",

3753> "hooks": [

3754> {

3755> "type": "command",

3756> "command": "powershell.exe",

3757> "args": [

3758> "-NoProfile",

3759> "-ExecutionPolicy",

3760> "Bypass",

3761> "-File",

3762> "${CLAUDE_PROJECT_DIR}/.claude/hooks/answer-project-key.ps1"

3763> ]

3764> }

3765> ]

3766> }

3767> ]

3768> }

3769> }

3770> ```

3771>

3772> Save this script to `.claude/hooks/answer-project-key.ps1` in your project:

3773>

3774> ```powershell theme={null}

3775> $request = [Console]::In.ReadToEnd() | ConvertFrom-Json

3776> $fields = @($request.requested_schema.properties.PSObject.Properties.Name)

3777>

3778> if ($fields.Count -eq 1 -and $fields[0] -eq 'project_key') {

3779> @{

3780> hookSpecificOutput = @{

3781> hookEventName = "Elicitation"

3782> action = "accept"

3783> content = @{ project_key = "DOCS" }

3784> }

3785> } | ConvertTo-Json -Depth 3

3786> }

3787> ```

3788 3788 

3789To confirm the hook works, start Claude Code with `claude --debug` and give Claude a task that makes the server ask for the project key. No dialog appears, and the [debug log](#debug-hooks) has a line that ends with `Elicitation resolved by hook: {"action":"accept","content":{"project_key":"DOCS"}}`.3789To confirm the hook works, start Claude Code with `claude --debug` and give Claude a task that makes the server ask for the project key. No dialog appears, and the [debug log](#debug-hooks) has a line that ends with `Elicitation resolved by hook: {"action":"accept","content":{"project_key":"DOCS"}}`.

3790 3790 

hooks-guide.md +144 −144

Details

89 89 

90Each tab below uses the platform's native notification command. Add this to `~/.claude/settings.json`:90Each tab below uses the platform's native notification command. Add this to `~/.claude/settings.json`:

91 91 

92**macOS**92> [tab] macOS

93 

94```json theme={null}

95{

96 "hooks": {

97 "Notification": [

98 {

99 "matcher": "",

100 "hooks": [

101 {

102 "type": "command",

103 "command": "osascript -e 'display notification \"Claude Code needs your attention\" with title \"Claude Code\"'"

104 }

105 ]

106 }

107 ]

108 }

109}

110```

111 

112> **If no notification appears**

113>

114> `osascript` routes notifications through the built-in Script Editor app. If Script Editor doesn't have notification permission, the command fails silently, and macOS won't prompt you to grant it.

115>93>

116> Run this in Terminal once to make Script Editor appear in your notification settings:94> ```json theme={null}

117>95> {

118> ```bash theme={null}96> "hooks": {

119> osascript -e 'display notification "test"'97> "Notification": [

98> {

99> "matcher": "",

100> "hooks": [

101> {

102> "type": "command",

103> "command": "osascript -e 'display notification \"Claude Code needs your attention\" with title \"Claude Code\"'"

104> }

105> ]

106> }

107> ]

108> }

109> }

120> ```110> ```

121>111>

122> Nothing will appear yet. Open **System Settings > Notifications**, find **Script Editor** in the list, and turn on **Allow Notifications**. Run the command again to confirm the test notification appears.112> > [accordion] If no notification appears

123 113> >

124**Linux**114> > `osascript` routes notifications through the built-in Script Editor app. If Script Editor doesn't have notification permission, the command fails silently, and macOS won't prompt you to grant it.

125 115> >

126```json theme={null}116> > Run this in Terminal once to make Script Editor appear in your notification settings:

127{117> >

128 "hooks": {118> > ```bash theme={null}

129 "Notification": [119> > osascript -e 'display notification "test"'

130 {120> > ```

131 "matcher": "",121> >

132 "hooks": [122> > Nothing will appear yet. Open **System Settings > Notifications**, find **Script Editor** in the list, and turn on **Allow Notifications**. Run the command again to confirm the test notification appears.

133 {123 

134 "type": "command",124> [tab] Linux

135 "command": "notify-send 'Claude Code' 'Claude Code needs your attention'"

136 }

137 ]

138 }

139 ]

140 }

141}

142```

143 

144> **If no notification appears**

145>

146> `notify-send` needs a desktop notification daemon, which headless servers, SSH sessions, and most containers don't have. Test the command directly first:

147>125>

148> ```bash theme={null}126> ```json theme={null}

149> notify-send 'Claude Code' 'test'127> {

128> "hooks": {

129> "Notification": [

130> {

131> "matcher": "",

132> "hooks": [

133> {

134> "type": "command",

135> "command": "notify-send 'Claude Code' 'Claude Code needs your attention'"

136> }

137> ]

138> }

139> ]

140> }

141> }

150> ```142> ```

151>143>

152> If the command isn't found, install the `libnotify-bin` package on Debian and Ubuntu, or your distribution's equivalent.144> > [accordion] If no notification appears

153 145> >

154**Windows (PowerShell)**146> > `notify-send` needs a desktop notification daemon, which headless servers, SSH sessions, and most containers don't have. Test the command directly first:

155 147> >

156```json theme={null}148> > ```bash theme={null}

157{149> > notify-send 'Claude Code' 'test'

158 "hooks": {150> > ```

159 "Notification": [151> >

160 {152> > If the command isn't found, install the `libnotify-bin` package on Debian and Ubuntu, or your distribution's equivalent.

161 "matcher": "",153 

162 "hooks": [154> [tab] Windows (PowerShell)

163 {

164 "type": "command",

165 "command": "powershell.exe -Command \"[System.Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms'); [System.Windows.Forms.MessageBox]::Show('Claude Code needs your attention', 'Claude Code')\""

166 }

167 ]

168 }

169 ]

170 }

171}

172```

173 

174> **If no dialog appears**

175>155>

176> This command opens a dialog box rather than a notification in the corner of your screen, so the dialog can open behind your terminal window. Test the command directly in PowerShell first.156> ```json theme={null}

157> {

158> "hooks": {

159> "Notification": [

160> {

161> "matcher": "",

162> "hooks": [

163> {

164> "type": "command",

165> "command": "powershell.exe -Command \"[System.Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms'); [System.Windows.Forms.MessageBox]::Show('Claude Code needs your attention', 'Claude Code')\""

166> }

167> ]

168> }

169> ]

170> }

171> }

172> ```

177>173>

178> If you run Claude Code inside WSL, `powershell.exe` must be available on your `PATH` through Windows interop.174> > [accordion] If no dialog appears

175> >

176> > This command opens a dialog box rather than a notification in the corner of your screen, so the dialog can open behind your terminal window. Test the command directly in PowerShell first.

177> >

178> > If you run Claude Code inside WSL, `powershell.exe` must be available on your `PATH` through Windows interop.

179 179 

180The empty `matcher` fires on all notification types. To fire only on specific events, set it to one of these values:180The empty `matcher` fires on all notification types. To fire only on specific events, set it to one of these values:

181 181 


705 705 

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

707 707 

708**Log every Bash command**708> [tab] Log every Bash command

709 709>

710Match only `Bash` tool calls and log each command to a file. The `PostToolUse` event fires after the command completes, so `tool_input.command` contains what ran. The hook receives the event data as JSON on stdin, and `jq -r '.tool_input.command'` extracts only the command string, which `>>` appends to the log file:710> Match only `Bash` tool calls and log each command to a file. The `PostToolUse` event fires after the command completes, so `tool_input.command` contains what ran. The hook receives the event data as JSON on stdin, and `jq -r '.tool_input.command'` extracts only the command string, which `>>` appends to the log file:

711 711>

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

713{713> {

714 "hooks": {714> "hooks": {

715 "PostToolUse": [715> "PostToolUse": [

716 {716> {

717 "matcher": "Bash",717> "matcher": "Bash",

718 "hooks": [718> "hooks": [

719 {719> {

720 "type": "command",720> "type": "command",

721 "command": "jq -r '.tool_input.command' >> ~/.claude/command-log.txt"721> "command": "jq -r '.tool_input.command' >> ~/.claude/command-log.txt"

722 }722> }

723 ]723> ]

724 }724> }

725 ]725> ]

726 }726> }

727}727> }

728```728> ```

729 

730**Match MCP tools**

731 

732MCP tools use a different naming convention than built-in tools: `mcp__<server>__<tool>`, where `<server>` is the MCP server name and `<tool>` is the tool it provides. For example, `mcp__github__search_repositories` or `mcp__filesystem__read_file`. Tools from a [plugin-bundled server](https://code.claude.com/docs/en/mcp.md#plugin-provided-mcp-servers) use a scoped server segment instead, such as `mcp__plugin_my-plugin_db__query`. Use a regex matcher to target all tools from a specific server, or match across servers with a pattern like `mcp__.*__write.*`. See [Match MCP tools](https://code.claude.com/docs/en/hooks.md#match-mcp-tools) in the reference for the full list of examples.

733 

734The command below extracts the tool name from the hook's JSON input with `jq` and writes it to stderr. Writing to stderr keeps stdout clean for JSON output and sends the message to the [debug log](https://code.claude.com/docs/en/hooks.md#debug-hooks):

735 

736```json theme={null}

737{

738 "hooks": {

739 "PreToolUse": [

740 {

741 "matcher": "mcp__github__.*",

742 "hooks": [

743 {

744 "type": "command",

745 "command": "echo \"GitHub tool called: $(jq -r '.tool_name')\" >&2"

746 }

747 ]

748 }

749 ]

750 }

751}

752```

753 

754**Clean up on session end**

755 729 

756The `SessionEnd` event supports matchers on the reason the session ended. This hook only fires on the `clear` reason, set when you run `/clear`, not on normal exits:730> [tab] Match MCP tools

731>

732> MCP tools use a different naming convention than built-in tools: `mcp__<server>__<tool>`, where `<server>` is the MCP server name and `<tool>` is the tool it provides. For example, `mcp__github__search_repositories` or `mcp__filesystem__read_file`. Tools from a [plugin-bundled server](https://code.claude.com/docs/en/mcp.md#plugin-provided-mcp-servers) use a scoped server segment instead, such as `mcp__plugin_my-plugin_db__query`. Use a regex matcher to target all tools from a specific server, or match across servers with a pattern like `mcp__.*__write.*`. See [Match MCP tools](https://code.claude.com/docs/en/hooks.md#match-mcp-tools) in the reference for the full list of examples.

733>

734> The command below extracts the tool name from the hook's JSON input with `jq` and writes it to stderr. Writing to stderr keeps stdout clean for JSON output and sends the message to the [debug log](https://code.claude.com/docs/en/hooks.md#debug-hooks):

735>

736> ```json theme={null}

737> {

738> "hooks": {

739> "PreToolUse": [

740> {

741> "matcher": "mcp__github__.*",

742> "hooks": [

743> {

744> "type": "command",

745> "command": "echo \"GitHub tool called: $(jq -r '.tool_name')\" >&2"

746> }

747> ]

748> }

749> ]

750> }

751> }

752> ```

757 753 

758```json theme={null}754> [tab] Clean up on session end

759{755>

760 "hooks": {756> The `SessionEnd` event supports matchers on the reason the session ended. This hook only fires on the `clear` reason, set when you run `/clear`, not on normal exits:

761 "SessionEnd": [757>

762 {758> ```json theme={null}

763 "matcher": "clear",759> {

764 "hooks": [760> "hooks": {

765 {761> "SessionEnd": [

766 "type": "command",762> {

767 "command": "rm -f /tmp/claude-scratch-*.txt"763> "matcher": "clear",

768 }764> "hooks": [

769 ]765> {

770 }766> "type": "command",

771 ]767> "command": "rm -f /tmp/claude-scratch-*.txt"

772 }768> }

773}769> ]

774```770> }

771> ]

772> }

773> }

774> ```

775 775 

776#### Filter by tool name and arguments with the `if` field776#### Filter by tool name and arguments with the `if` field

777 777 

Details

163 163 

164Choose a permission mode to set what Claude can do without asking you. Press `Shift+Tab` to cycle through the permission modes:164Choose a permission mode to set what Claude can do without asking you. Press `Shift+Tab` to cycle through the permission modes:

165 165 

166* **Auto**: a classifier reviews most actions in the background and blocks the risky ones instead of asking you. With Claude Code v2.1.283 or later, it's the [built-in starting permission mode](https://code.claude.com/docs/en/permission-modes.md#which-mode-a-session-starts-in) for interactive terminal and VS Code sessions, and on earlier versions only on Pro, Max, and Team plans166* **Auto**: a classifier reviews most actions in the background and blocks the risky ones instead of asking you. With Claude Code v2.1.283 or later, it's the [built-in starting permission mode](https://code.claude.com/docs/en/permission-modes.md#which-mode-a-session-starts-in) for interactive terminal and VS Code sessions. On earlier versions, it's the built-in starting permission mode only on Pro, Max, Ultra, and Team plans.

167* **Manual**: Claude asks before file edits and shell commands167* **Manual**: Claude asks before file edits and shell commands

168* **Accept edits**: Claude edits files and runs common filesystem commands like `mkdir` and `mv` without asking, still asks for other commands168* **Accept edits**: Claude edits files and runs common filesystem commands like `mkdir` and `mv` without asking, still asks for other commands

169* **Plan**: Claude explores and proposes a plan without editing your source files169* **Plan**: Claude explores and proposes a plan without editing your source files


223 223 

224## What's next224## What's next

225 225 

226> **[Extend with features](https://code.claude.com/docs/en/features-overview.md)**226> [card] [Extend with features](https://code.claude.com/docs/en/features-overview.md)

227>227>

228> Add skills and MCP connections228> Add skills and MCP connections

229 229 

230> **[Common workflows](https://code.claude.com/docs/en/common-workflows.md)**230> [card] [Common workflows](https://code.claude.com/docs/en/common-workflows.md)

231>231>

232> Step-by-step guides for typical tasks232> Step-by-step guides for typical tasks

Details

537 537 

538Claude Code reads the [`spellcheck`](https://code.claude.com/docs/en/settings-reference#spellcheck) setting from three places, and ignores it in a project's `.claude/settings.json` and `.claude/settings.local.json`. Turn it on from whichever one you use:538Claude Code reads the [`spellcheck`](https://code.claude.com/docs/en/settings-reference#spellcheck) setting from three places, and ignores it in a project's `.claude/settings.json` and `.claude/settings.local.json`. Turn it on from whichever one you use:

539 539 

540**User settings**540> [tab] User settings

541 541>

542Add `spellcheck` to `~/.claude/settings.json`. It applies in every project you open, like the rest of your [user settings](https://code.claude.com/docs/en/settings.md#where-settings-live):542> Add `spellcheck` to `~/.claude/settings.json`. It applies in every project you open, like the rest of your [user settings](https://code.claude.com/docs/en/settings.md#where-settings-live):

543 543>

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

545{545> {

546 "spellcheck": { "enabled": true }546> "spellcheck": { "enabled": true }

547}547> }

548```548> ```

549 

550**Command line**

551 

552Save `spellcheck` in a JSON file, such as `spellcheck.json`:

553 

554```json theme={null}

555{

556 "spellcheck": { "enabled": true }

557}

558```

559 

560Then pass the file to `--settings`. It applies to that session only:

561 

562```bash theme={null}

563claude --settings spellcheck.json

564```

565 

566**Managed settings**

567 549 

568Add `spellcheck` to one of your organization's [managed settings sources](https://code.claude.com/docs/en/permissions.md#managed-settings). It applies to every user who receives those settings, and they can't turn it off:550> [tab] Command line

551>

552> Save `spellcheck` in a JSON file, such as `spellcheck.json`:

553>

554> ```json theme={null}

555> {

556> "spellcheck": { "enabled": true }

557> }

558> ```

559>

560> Then pass the file to `--settings`. It applies to that session only:

561>

562> ```bash theme={null}

563> claude --settings spellcheck.json

564> ```

569 565 

570```json theme={null}566> [tab] Managed settings

571{567>

572 "spellcheck": { "enabled": true }568> Add `spellcheck` to one of your organization's [managed settings sources](https://code.claude.com/docs/en/permissions.md#managed-settings). It applies to every user who receives those settings, and they can't turn it off:

573}569>

574```570> ```json theme={null}

571> {

572> "spellcheck": { "enabled": true }

573> }

574> ```

575 575 

576To check that spell checking is on, type a misspelled word and a space. Claude Code underlines the word. If it doesn't, see [When Claude Code underlines nothing](#when-claude-code-underlines-nothing). To turn spell checking off again, set `enabled` to `false` in the same place, or remove `spellcheck`.576To check that spell checking is on, type a misspelled word and a space. Claude Code underlines the word. If it doesn't, see [When Claude Code underlines nothing](#when-claude-code-underlines-nothing). To turn spell checking off again, set `enabled` to `false` in the same place, or remove `spellcheck`.

577 577 

jetbrains.md +1 −1

Details

41 41 

42If `claude` is installed somewhere your IDE can't find, set the full path in the plugin's [Claude command setting](#general-settings).42If `claude` is installed somewhere your IDE can't find, set the full path in the plugin's [Claude command setting](#general-settings).

43 43 

44Claude Code works with any paid Claude subscription (Pro, Max, Team, or Enterprise) or a Claude Console account, and no API key is required. You'll be prompted to [log in](https://code.claude.com/docs/en/authentication.md#log-in-to-claude-code) the first time you run `claude`.44Claude Code works with any paid Claude subscription (Pro, Max, Ultra, Team, or Enterprise) or a Claude Console account, and no API key is required. You'll be prompted to [log in](https://code.claude.com/docs/en/authentication.md#log-in-to-claude-code) the first time you run `claude`.

45 45 

46## Usage46## Usage

47 47 

Details

73 73 

74Replace the values with the ones your gateway team gave you:74Replace the values with the ones your gateway team gave you:

75 75 

76**Bash or Zsh**76> [tab] Bash or Zsh

77 77>

78```bash theme={null}78> ```bash theme={null}

79export ANTHROPIC_BASE_URL=https://llm-gateway.example.com79> export ANTHROPIC_BASE_URL=https://llm-gateway.example.com

80export ANTHROPIC_AUTH_TOKEN=sk-gateway-key80> export ANTHROPIC_AUTH_TOKEN=sk-gateway-key

81```81> ```

82 

83**PowerShell**

84 82 

85```powershell theme={null}83> [tab] PowerShell

86$env:ANTHROPIC_BASE_URL = "https://llm-gateway.example.com"84>

87$env:ANTHROPIC_AUTH_TOKEN = "sk-gateway-key"85> ```powershell theme={null}

88```86> $env:ANTHROPIC_BASE_URL = "https://llm-gateway.example.com"

87> $env:ANTHROPIC_AUTH_TOKEN = "sk-gateway-key"

88> ```

89 89 

90Shell exports apply only to that terminal session and programs started from it. An editor launched from the dock or Start menu won't see them. To make the values persist across new terminals, add the same lines to your shell profile, such as `~/.zshrc`, `~/.bashrc`, or your PowerShell `$PROFILE`.90Shell exports apply only to that terminal session and programs started from it. An editor launched from the dock or Start menu won't see them. To make the values persist across new terminals, add the same lines to your shell profile, such as `~/.zshrc`, `~/.bashrc`, or your PowerShell `$PROFILE`.

91 91 


119 119 

120With the variables exported in your shell, send a one-token request to the gateway directly. This confirms the URL and credential work before you open Claude Code, so a failure points at the gateway rather than your configuration. The commands below read the shell variables, so they need the [shell exports](#set-as-shell-environment-variables) even if you also put the values in a settings file.120With the variables exported in your shell, send a one-token request to the gateway directly. This confirms the URL and credential work before you open Claude Code, so a failure points at the gateway rather than your configuration. The commands below read the shell variables, so they need the [shell exports](#set-as-shell-environment-variables) even if you also put the values in a settings file.

121 121 

122**Bash or Zsh**122> [tab] Bash or Zsh

123 123>

124```bash theme={null}124> ```bash theme={null}

125curl -sS -w '\n%{http_code}\n' -X POST "$ANTHROPIC_BASE_URL/v1/messages" \125> curl -sS -w '\n%{http_code}\n' -X POST "$ANTHROPIC_BASE_URL/v1/messages" \

126 -H "Authorization: Bearer $ANTHROPIC_AUTH_TOKEN" \126> -H "Authorization: Bearer $ANTHROPIC_AUTH_TOKEN" \

127 -H "anthropic-version: 2023-06-01" \127> -H "anthropic-version: 2023-06-01" \

128 -H "content-type: application/json" \128> -H "content-type: application/json" \

129 -d '{"model": "claude-sonnet-4-6", "max_tokens": 1, "messages": [{"role": "user", "content": "."}]}'129> -d '{"model": "claude-sonnet-4-6", "max_tokens": 1, "messages": [{"role": "user", "content": "."}]}'

130```130> ```

131 131 

132**PowerShell**132> [tab] PowerShell

133 133>

134```powershell theme={null}134> ```powershell theme={null}

135Invoke-RestMethod -Method Post -Uri "$env:ANTHROPIC_BASE_URL/v1/messages" `135> Invoke-RestMethod -Method Post -Uri "$env:ANTHROPIC_BASE_URL/v1/messages" `

136 -Headers @{ "Authorization" = "Bearer $env:ANTHROPIC_AUTH_TOKEN"; "anthropic-version" = "2023-06-01" } `136> -Headers @{ "Authorization" = "Bearer $env:ANTHROPIC_AUTH_TOKEN"; "anthropic-version" = "2023-06-01" } `

137 -ContentType "application/json" `137> -ContentType "application/json" `

138 -Body '{"model": "claude-sonnet-4-6", "max_tokens": 1, "messages": [{"role": "user", "content": "."}]}'138> -Body '{"model": "claude-sonnet-4-6", "max_tokens": 1, "messages": [{"role": "user", "content": "."}]}'

139```139> ```

140 140 

141If your gateway expects keys in the `x-api-key` header, replace the `Authorization` header with `x-api-key: $ANTHROPIC_API_KEY` in the Bash command, or the `"Authorization"` hashtable entry with `"x-api-key" = "$env:ANTHROPIC_API_KEY"` in the PowerShell command.141If your gateway expects keys in the `x-api-key` header, replace the `Authorization` header with `x-api-key: $ANTHROPIC_API_KEY` in the Bash command, or the `"Authorization"` hashtable entry with `"x-api-key" = "$env:ANTHROPIC_API_KEY"` in the PowerShell command.

142 142 


274 274 

275Some gateways route or tag requests using a custom header in addition to the credential, for example a tenant identifier or a routing key. To send one, set [`ANTHROPIC_CUSTOM_HEADERS`](https://code.claude.com/docs/en/env-vars) with one `Name: Value` pair per line. The example below adds a routing header named `X-Org-Route`:275Some gateways route or tag requests using a custom header in addition to the credential, for example a tenant identifier or a routing key. To send one, set [`ANTHROPIC_CUSTOM_HEADERS`](https://code.claude.com/docs/en/env-vars) with one `Name: Value` pair per line. The example below adds a routing header named `X-Org-Route`:

276 276 

277**Bash or Zsh**277> [tab] Bash or Zsh

278 278>

279```bash theme={null}279> ```bash theme={null}

280export ANTHROPIC_CUSTOM_HEADERS="X-Org-Route: prod"280> export ANTHROPIC_CUSTOM_HEADERS="X-Org-Route: prod"

281```281> ```

282 

283**PowerShell**

284 282 

285```powershell theme={null}283> [tab] PowerShell

286$env:ANTHROPIC_CUSTOM_HEADERS = "X-Org-Route: prod"284>

287```285> ```powershell theme={null}

286> $env:ANTHROPIC_CUSTOM_HEADERS = "X-Org-Route: prod"

287> ```

288 288 

289You can also set `ANTHROPIC_CUSTOM_HEADERS` in the `env` block of a settings file. Use `\n` between pairs there, since JSON strings can't span multiple lines:289You can also set `ANTHROPIC_CUSTOM_HEADERS` in the `env` block of a settings file. Use `\n` between pairs there, since JSON strings can't span multiple lines:

290 290 


318 318 

319The helper is any shell command that prints the current credential to stdout. Claude Code runs it through your system shell, so on Windows it can be an executable or a PowerShell invocation. Make the command print nothing but the credential. On Claude Code v2.1.227 or later, a banner or a log line printed alongside the key makes the [helper fail](https://code.claude.com/docs/en/errors.md#your-apikeyhelper-script-is-failing). Write the script, make it executable, and reference it from `apiKeyHelper` in your [settings file](https://code.claude.com/docs/en/settings.md):319The helper is any shell command that prints the current credential to stdout. Claude Code runs it through your system shell, so on Windows it can be an executable or a PowerShell invocation. Make the command print nothing but the credential. On Claude Code v2.1.227 or later, a banner or a log line printed alongside the key makes the [helper fail](https://code.claude.com/docs/en/errors.md#your-apikeyhelper-script-is-failing). Write the script, make it executable, and reference it from `apiKeyHelper` in your [settings file](https://code.claude.com/docs/en/settings.md):

320 320 

321**Bash or Zsh**321> [tab] Bash or Zsh

322 322>

323For example, a script that reads from a vault:323> For example, a script that reads from a vault:

324 324>

325```bash theme={null}325> ```bash theme={null}

326#!/bin/bash326> #!/bin/bash

327vault kv get -field=api_key secret/llm-gateway/claude-code327> vault kv get -field=api_key secret/llm-gateway/claude-code

328```328> ```

329 329>

330Reference its path in `~/.claude/settings.json`:330> Reference its path in `~/.claude/settings.json`:

331 331>

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

333{333> {

334 "apiKeyHelper": "~/bin/get-gateway-key.sh"334> "apiKeyHelper": "~/bin/get-gateway-key.sh"

335}335> }

336```336> ```

337 

338**PowerShell**

339 

340For example, a script that reads from a vault:

341 

342```powershell theme={null}

343vault kv get -field=api_key secret/llm-gateway/claude-code

344```

345 

346Reference the PowerShell invocation in `%USERPROFILE%\.claude\settings.json`, escaping the backslashes in the JSON string:

347 337 

348```json theme={null}338> [tab] PowerShell

349{339>

350 "apiKeyHelper": "powershell -NoProfile -File C:\\scripts\\get-gateway-key.ps1"340> For example, a script that reads from a vault:

351}341>

352```342> ```powershell theme={null}

343> vault kv get -field=api_key secret/llm-gateway/claude-code

344> ```

345>

346> Reference the PowerShell invocation in `%USERPROFILE%\.claude\settings.json`, escaping the backslashes in the JSON string:

347>

348> ```json theme={null}

349> {

350> "apiKeyHelper": "powershell -NoProfile -File C:\\scripts\\get-gateway-key.ps1"

351> }

352> ```

353 353 

354Claude Code caches the helper's output for five minutes by default and re-runs the helper after the cache lifetime elapses. To change the lifetime, set `CLAUDE_CODE_API_KEY_HELPER_TTL_MS` in milliseconds, for example `CLAUDE_CODE_API_KEY_HELPER_TTL_MS=900000` for 15 minutes.354Claude Code caches the helper's output for five minutes by default and re-runs the helper after the cache lifetime elapses. To change the lifetime, set `CLAUDE_CODE_API_KEY_HELPER_TTL_MS` in milliseconds, for example `CLAUDE_CODE_API_KEY_HELPER_TTL_MS=900000` for 15 minutes.

355 355 


363 363 

364To turn that traffic off, set `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1` alongside the gateway variables, in the same shell exports or settings-file `env` block:364To turn that traffic off, set `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1` alongside the gateway variables, in the same shell exports or settings-file `env` block:

365 365 

366**Bash or Zsh**366> [tab] Bash or Zsh

367 367>

368```bash theme={null}368> ```bash theme={null}

369export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1369> export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1

370```370> ```

371 

372**PowerShell**

373 371 

374```powershell theme={null}372> [tab] PowerShell

375$env:CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC = "1"373>

376```374> ```powershell theme={null}

375> $env:CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC = "1"

376> ```

377 377 

378Setting the variable has these effects and limits:378Setting the variable has these effects and limits:

379 379 


398 398 

399Leave `AWS_BEARER_TOKEN_BEDROCK` unset when the gateway issues its own credential. If you set it, Claude Code sends that [Amazon Bedrock API key](https://code.claude.com/docs/en/amazon-bedrock.md#2-configure-aws-credentials) as the `Authorization` header instead of your gateway token, even with `CLAUDE_CODE_SKIP_BEDROCK_AUTH` set.399Leave `AWS_BEARER_TOKEN_BEDROCK` unset when the gateway issues its own credential. If you set it, Claude Code sends that [Amazon Bedrock API key](https://code.claude.com/docs/en/amazon-bedrock.md#2-configure-aws-credentials) as the `Authorization` header instead of your gateway token, even with `CLAUDE_CODE_SKIP_BEDROCK_AUTH` set.

400 400 

401**Bash or Zsh**401> [tab] Bash or Zsh

402 402>

403```bash theme={null}403> ```bash theme={null}

404export ANTHROPIC_BEDROCK_BASE_URL=https://llm-gateway.example.com/bedrock404> export ANTHROPIC_BEDROCK_BASE_URL=https://llm-gateway.example.com/bedrock

405export CLAUDE_CODE_SKIP_BEDROCK_AUTH=1405> export CLAUDE_CODE_SKIP_BEDROCK_AUTH=1

406export CLAUDE_CODE_USE_BEDROCK=1406> export CLAUDE_CODE_USE_BEDROCK=1

407```407> ```

408 

409**PowerShell**

410 408 

411```powershell theme={null}409> [tab] PowerShell

412$env:ANTHROPIC_BEDROCK_BASE_URL = "https://llm-gateway.example.com/bedrock"410>

413$env:CLAUDE_CODE_SKIP_BEDROCK_AUTH = "1"411> ```powershell theme={null}

414$env:CLAUDE_CODE_USE_BEDROCK = "1"412> $env:ANTHROPIC_BEDROCK_BASE_URL = "https://llm-gateway.example.com/bedrock"

415```413> $env:CLAUDE_CODE_SKIP_BEDROCK_AUTH = "1"

414> $env:CLAUDE_CODE_USE_BEDROCK = "1"

415> ```

416 416 

417#### Google Cloud's Agent Platform417#### Google Cloud's Agent Platform

418 418 

419Replace the project ID and region with your own values. Claude Code includes both in the path of each request it sends to the gateway:419Replace the project ID and region with your own values. Claude Code includes both in the path of each request it sends to the gateway:

420 420 

421**Bash or Zsh**421> [tab] Bash or Zsh

422 422>

423```bash theme={null}423> ```bash theme={null}

424export ANTHROPIC_VERTEX_BASE_URL=https://llm-gateway.example.com/vertex424> export ANTHROPIC_VERTEX_BASE_URL=https://llm-gateway.example.com/vertex

425export ANTHROPIC_VERTEX_PROJECT_ID=your-gcp-project-id425> export ANTHROPIC_VERTEX_PROJECT_ID=your-gcp-project-id

426export CLAUDE_CODE_SKIP_VERTEX_AUTH=1426> export CLAUDE_CODE_SKIP_VERTEX_AUTH=1

427export CLAUDE_CODE_USE_VERTEX=1427> export CLAUDE_CODE_USE_VERTEX=1

428export CLOUD_ML_REGION=us-east5428> export CLOUD_ML_REGION=us-east5

429```429> ```

430 430 

431**PowerShell**431> [tab] PowerShell

432 432>

433```powershell theme={null}433> ```powershell theme={null}

434$env:ANTHROPIC_VERTEX_BASE_URL = "https://llm-gateway.example.com/vertex"434> $env:ANTHROPIC_VERTEX_BASE_URL = "https://llm-gateway.example.com/vertex"

435$env:ANTHROPIC_VERTEX_PROJECT_ID = "your-gcp-project-id"435> $env:ANTHROPIC_VERTEX_PROJECT_ID = "your-gcp-project-id"

436$env:CLAUDE_CODE_SKIP_VERTEX_AUTH = "1"436> $env:CLAUDE_CODE_SKIP_VERTEX_AUTH = "1"

437$env:CLAUDE_CODE_USE_VERTEX = "1"437> $env:CLAUDE_CODE_USE_VERTEX = "1"

438$env:CLOUD_ML_REGION = "us-east5"438> $env:CLOUD_ML_REGION = "us-east5"

439```439> ```

440 440 

441The block covers routing and authentication. The region overrides and model pins from the [Agent Platform setup](https://code.claude.com/docs/en/google-vertex-ai.md#4-configure-claude-code) apply through a gateway as well:441The block covers routing and authentication. The region overrides and model pins from the [Agent Platform setup](https://code.claude.com/docs/en/google-vertex-ai.md#4-configure-claude-code) apply through a gateway as well:

442 442 


450 450 

451For a gateway that injects its own `Authorization` header, set `CLAUDE_CODE_SKIP_FOUNDRY_AUTH=1` and leave both credential variables unset. Claude Code then sends requests without an Azure credential and preserves the `Authorization` header you supply, for example through `ANTHROPIC_CUSTOM_HEADERS`.451For a gateway that injects its own `Authorization` header, set `CLAUDE_CODE_SKIP_FOUNDRY_AUTH=1` and leave both credential variables unset. Claude Code then sends requests without an Azure credential and preserves the `Authorization` header you supply, for example through `ANTHROPIC_CUSTOM_HEADERS`.

452 452 

453**Bash or Zsh**453> [tab] Bash or Zsh

454 454>

455```bash theme={null}455> ```bash theme={null}

456export ANTHROPIC_FOUNDRY_BASE_URL=https://llm-gateway.example.com/foundry456> export ANTHROPIC_FOUNDRY_BASE_URL=https://llm-gateway.example.com/foundry

457export ANTHROPIC_FOUNDRY_API_KEY=sk-gateway-key457> export ANTHROPIC_FOUNDRY_API_KEY=sk-gateway-key

458export CLAUDE_CODE_USE_FOUNDRY=1458> export CLAUDE_CODE_USE_FOUNDRY=1

459```459> ```

460 

461**PowerShell**

462 460 

463```powershell theme={null}461> [tab] PowerShell

464$env:ANTHROPIC_FOUNDRY_BASE_URL = "https://llm-gateway.example.com/foundry"462>

465$env:ANTHROPIC_FOUNDRY_API_KEY = "sk-gateway-key"463> ```powershell theme={null}

466$env:CLAUDE_CODE_USE_FOUNDRY = "1"464> $env:ANTHROPIC_FOUNDRY_BASE_URL = "https://llm-gateway.example.com/foundry"

467```465> $env:ANTHROPIC_FOUNDRY_API_KEY = "sk-gateway-key"

466> $env:CLAUDE_CODE_USE_FOUNDRY = "1"

467> ```

468 468 

469#### Claude Platform on AWS469#### Claude Platform on AWS

470 470 

471See [Claude Platform on AWS](https://code.claude.com/docs/en/claude-platform-on-aws.md) for the workspace ID.471See [Claude Platform on AWS](https://code.claude.com/docs/en/claude-platform-on-aws.md) for the workspace ID.

472 472 

473**Bash or Zsh**473> [tab] Bash or Zsh

474 474>

475```bash theme={null}475> ```bash theme={null}

476export ANTHROPIC_AWS_BASE_URL=https://llm-gateway.example.com/anthropic-aws476> export ANTHROPIC_AWS_BASE_URL=https://llm-gateway.example.com/anthropic-aws

477export ANTHROPIC_AWS_WORKSPACE_ID=wrkspc_01ABCDEFGHIJKLMN477> export ANTHROPIC_AWS_WORKSPACE_ID=wrkspc_01ABCDEFGHIJKLMN

478export CLAUDE_CODE_SKIP_ANTHROPIC_AWS_AUTH=1478> export CLAUDE_CODE_SKIP_ANTHROPIC_AWS_AUTH=1

479export CLAUDE_CODE_USE_ANTHROPIC_AWS=1479> export CLAUDE_CODE_USE_ANTHROPIC_AWS=1

480```480> ```

481 481 

482**PowerShell**482> [tab] PowerShell

483 483>

484```powershell theme={null}484> ```powershell theme={null}

485$env:ANTHROPIC_AWS_BASE_URL = "https://llm-gateway.example.com/anthropic-aws"485> $env:ANTHROPIC_AWS_BASE_URL = "https://llm-gateway.example.com/anthropic-aws"

486$env:ANTHROPIC_AWS_WORKSPACE_ID = "wrkspc_01ABCDEFGHIJKLMN"486> $env:ANTHROPIC_AWS_WORKSPACE_ID = "wrkspc_01ABCDEFGHIJKLMN"

487$env:CLAUDE_CODE_SKIP_ANTHROPIC_AWS_AUTH = "1"487> $env:CLAUDE_CODE_SKIP_ANTHROPIC_AWS_AUTH = "1"

488$env:CLAUDE_CODE_USE_ANTHROPIC_AWS = "1"488> $env:CLAUDE_CODE_USE_ANTHROPIC_AWS = "1"

489```489> ```

490 490 

491#### Confirm the provider route491#### Confirm the provider route

492 492 

Details

62* `<gateway-key>` is whatever credential lets you call the gateway right now: an administrative key, a test key, or your own developer key if you've already issued one. Not every gateway product has a separate admin credential; if yours doesn't, issue yourself a developer key in [Issue developer credentials](#issue-developer-credentials) first62* `<gateway-key>` is whatever credential lets you call the gateway right now: an administrative key, a test key, or your own developer key if you've already issued one. Not every gateway product has a separate admin credential; if yours doesn't, issue yourself a developer key in [Issue developer credentials](#issue-developer-credentials) first

63* `model` is a Claude model name your gateway is configured to route. The example uses `claude-sonnet-4-6`; substitute a name you've configured63* `model` is a Claude model name your gateway is configured to route. The example uses `claude-sonnet-4-6`; substitute a name you've configured

64 64 

65**Bash or Zsh**65> [tab] Bash or Zsh

66 66>

67```bash theme={null}67> ```bash theme={null}

68curl -X POST "https://llm-gateway.example.com/v1/messages" \68> curl -X POST "https://llm-gateway.example.com/v1/messages" \

69 -H "Authorization: Bearer <gateway-key>" \69> -H "Authorization: Bearer <gateway-key>" \

70 -H "anthropic-version: 2023-06-01" \70> -H "anthropic-version: 2023-06-01" \

71 -H "content-type: application/json" \71> -H "content-type: application/json" \

72 -d '{"model": "claude-sonnet-4-6", "max_tokens": 1, "messages": [{"role": "user", "content": "."}]}'72> -d '{"model": "claude-sonnet-4-6", "max_tokens": 1, "messages": [{"role": "user", "content": "."}]}'

73```73> ```

74 74 

75**PowerShell**75> [tab] PowerShell

76 76>

77```powershell theme={null}77> ```powershell theme={null}

78Invoke-RestMethod -Method Post -Uri "https://llm-gateway.example.com/v1/messages" `78> Invoke-RestMethod -Method Post -Uri "https://llm-gateway.example.com/v1/messages" `

79 -Headers @{ "Authorization" = "Bearer <gateway-key>"; "anthropic-version" = "2023-06-01" } `79> -Headers @{ "Authorization" = "Bearer <gateway-key>"; "anthropic-version" = "2023-06-01" } `

80 -ContentType "application/json" `80> -ContentType "application/json" `

81 -Body '{"model": "claude-sonnet-4-6", "max_tokens": 1, "messages": [{"role": "user", "content": "."}]}'81> -Body '{"model": "claude-sonnet-4-6", "max_tokens": 1, "messages": [{"role": "user", "content": "."}]}'

82```82> ```

83 83 

84**Checkpoint**: a `200` with a `content` field means the gateway reached the provider with that model name. A `404` means that name isn't routed at the gateway; a `401` from the provider means the gateway's provider credential is wrong.84**Checkpoint**: a `200` with a `content` field means the gateway reached the provider with that model name. A `404` means that name isn't routed at the gateway; a `401` from the provider means the gateway's provider credential is wrong.

85 85 


95 95 

96Confirm a freshly issued key works against the gateway with the same request as [Confirm the gateway routes your models](#confirm-the-gateway-routes-your-models), replacing `<gateway-key>` with the new `<developer-key>`:96Confirm a freshly issued key works against the gateway with the same request as [Confirm the gateway routes your models](#confirm-the-gateway-routes-your-models), replacing `<gateway-key>` with the new `<developer-key>`:

97 97 

98**Bash or Zsh**98> [tab] Bash or Zsh

99 99>

100```bash theme={null}100> ```bash theme={null}

101curl -X POST "https://llm-gateway.example.com/v1/messages" \101> curl -X POST "https://llm-gateway.example.com/v1/messages" \

102 -H "Authorization: Bearer <developer-key>" \102> -H "Authorization: Bearer <developer-key>" \

103 -H "anthropic-version: 2023-06-01" \103> -H "anthropic-version: 2023-06-01" \

104 -H "content-type: application/json" \104> -H "content-type: application/json" \

105 -d '{"model": "claude-sonnet-4-6", "max_tokens": 1, "messages": [{"role": "user", "content": "."}]}'105> -d '{"model": "claude-sonnet-4-6", "max_tokens": 1, "messages": [{"role": "user", "content": "."}]}'

106```106> ```

107 107 

108**PowerShell**108> [tab] PowerShell

109 109>

110```powershell theme={null}110> ```powershell theme={null}

111Invoke-RestMethod -Method Post -Uri "https://llm-gateway.example.com/v1/messages" `111> Invoke-RestMethod -Method Post -Uri "https://llm-gateway.example.com/v1/messages" `

112 -Headers @{ "Authorization" = "Bearer <developer-key>"; "anthropic-version" = "2023-06-01" } `112> -Headers @{ "Authorization" = "Bearer <developer-key>"; "anthropic-version" = "2023-06-01" } `

113 -ContentType "application/json" `113> -ContentType "application/json" `

114 -Body '{"model": "claude-sonnet-4-6", "max_tokens": 1, "messages": [{"role": "user", "content": "."}]}'114> -Body '{"model": "claude-sonnet-4-6", "max_tokens": 1, "messages": [{"role": "user", "content": "."}]}'

115```115> ```

116 116 

117**Checkpoint**: a `200` with a `content` field means the developer key reaches the gateway and the gateway forwards it. A `401` here, when [the previous step](#confirm-the-gateway-routes-your-models) succeeded, means the developer key is wrong or hasn't taken effect at the gateway yet.117**Checkpoint**: a `200` with a `content` field means the developer key reaches the gateway and the gateway forwards it. A `401` here, when [the previous step](#confirm-the-gateway-routes-your-models) succeeded, means the developer key is wrong or hasn't taken effect at the gateway yet.

118 118 


122 122 

123Run Claude Code through the gateway yourself before distributing anything, using the same configuration the rollout will deliver fleet-wide. Type these directly in a terminal, not in a `.env` or settings file; they last only for this terminal session, so closing it returns your machine to its normal configuration. Use `ANTHROPIC_API_KEY` instead of `ANTHROPIC_AUTH_TOKEN` if your gateway reads the `x-api-key` header:123Run Claude Code through the gateway yourself before distributing anything, using the same configuration the rollout will deliver fleet-wide. Type these directly in a terminal, not in a `.env` or settings file; they last only for this terminal session, so closing it returns your machine to its normal configuration. Use `ANTHROPIC_API_KEY` instead of `ANTHROPIC_AUTH_TOKEN` if your gateway reads the `x-api-key` header:

124 124 

125**Bash or Zsh**125> [tab] Bash or Zsh

126 126>

127```bash theme={null}127> ```bash theme={null}

128export ANTHROPIC_BASE_URL=https://llm-gateway.example.com128> export ANTHROPIC_BASE_URL=https://llm-gateway.example.com

129export ANTHROPIC_AUTH_TOKEN="<developer-key>"129> export ANTHROPIC_AUTH_TOKEN="<developer-key>"

130```130> ```

131 

132**PowerShell**

133 131 

134```powershell theme={null}132> [tab] PowerShell

135$env:ANTHROPIC_BASE_URL = "https://llm-gateway.example.com"133>

136$env:ANTHROPIC_AUTH_TOKEN = "<developer-key>"134> ```powershell theme={null}

137```135> $env:ANTHROPIC_BASE_URL = "https://llm-gateway.example.com"

136> $env:ANTHROPIC_AUTH_TOKEN = "<developer-key>"

137> ```

138 138 

139Then send a one-shot prompt through the gateway:139Then send a one-shot prompt through the gateway:

140 140 


224 224 

225Confirm everything works from a developer machine, not the gateway host, so the test covers the network path developers use. Send a streaming request, which checks the endpoint, streaming pass-through, and model routing at once:225Confirm everything works from a developer machine, not the gateway host, so the test covers the network path developers use. Send a streaming request, which checks the endpoint, streaming pass-through, and model routing at once:

226 226 

227**Bash or Zsh**227> [tab] Bash or Zsh

228 228>

229```bash theme={null}229> ```bash theme={null}

230curl -N -X POST "https://llm-gateway.example.com/v1/messages" \230> curl -N -X POST "https://llm-gateway.example.com/v1/messages" \

231 -H "Authorization: Bearer <developer-key>" \231> -H "Authorization: Bearer <developer-key>" \

232 -H "anthropic-version: 2023-06-01" \232> -H "anthropic-version: 2023-06-01" \

233 -H "content-type: application/json" \233> -H "content-type: application/json" \

234 -d '{"model": "claude-sonnet-4-6", "max_tokens": 16, "stream": true, "messages": [{"role": "user", "content": "count to 3"}]}'234> -d '{"model": "claude-sonnet-4-6", "max_tokens": 16, "stream": true, "messages": [{"role": "user", "content": "count to 3"}]}'

235```235> ```

236 236 

237**PowerShell**237> [tab] PowerShell

238 238>

239```powershell theme={null}239> ```powershell theme={null}

240$body = '{"model": "claude-sonnet-4-6", "max_tokens": 16, "stream": true, "messages": [{"role": "user", "content": "count to 3"}]}'240> $body = '{"model": "claude-sonnet-4-6", "max_tokens": 16, "stream": true, "messages": [{"role": "user", "content": "count to 3"}]}'

241$body | curl.exe -N -X POST "https://llm-gateway.example.com/v1/messages" `241> $body | curl.exe -N -X POST "https://llm-gateway.example.com/v1/messages" `

242 -H "Authorization: Bearer <developer-key>" `242> -H "Authorization: Bearer <developer-key>" `

243 -H "anthropic-version: 2023-06-01" `243> -H "anthropic-version: 2023-06-01" `

244 -H "content-type: application/json" `244> -H "content-type: application/json" `

245 --data-binary '@-'245> --data-binary '@-'

246```246> ```

247 247 

248You should see `data:` lines arrive incrementally. The whole response arriving at once after a pause means the gateway is buffering, which stalls Claude Code; a `404` means the model name isn't routed. Repeat per model name.248You should see `data:` lines arrive incrementally. The whole response arriving at once after a pause means the gateway is buffering, which stalls Claude Code; a `404` means the model name isn't routed. Repeat per model name.

249 249 

managed-mcp.md +5 −5

Details

403 403 

404The accordions below walk through how a server is evaluated against other allowlist and denylist combinations.404The accordions below walk through how a server is evaluated against other allowlist and denylist combinations.

405 405 

406> **URL-only allowlist**406> [accordion] URL-only allowlist

407>407>

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

409> {409> {


421> | HTTP server at `https://external.example.com/mcp` | Blocked: doesn't match any URL pattern |421> | HTTP server at `https://external.example.com/mcp` | Blocked: doesn't match any URL pattern |

422> | Stdio server with any command | Blocked: no name or command entries to match |422> | Stdio server with any command | Blocked: no name or command entries to match |

423 423 

424> **Command-only allowlist**424> [accordion] Command-only allowlist

425>425>

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

427> {427> {


437> | Stdio server with `["node", "server.js"]` | Blocked: doesn't match command |437> | Stdio server with `["node", "server.js"]` | Blocked: doesn't match command |

438> | HTTP server named `my-api` | Blocked: no name entries to match |438> | HTTP server named `my-api` | Blocked: no name entries to match |

439 439 

440> **Mixed name and command allowlist**440> [accordion] Mixed name and command allowlist

441>441>

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

443> {443> {


456> | HTTP server named `github` | Allowed: matches name |456> | HTTP server named `github` | Allowed: matches name |

457> | HTTP server named `other-api` | Blocked: name doesn't match |457> | HTTP server named `other-api` | Blocked: name doesn't match |

458 458 

459> **Name-only allowlist**459> [accordion] Name-only allowlist

460>460>

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

462> {462> {


474> | HTTP server named `github` | Allowed: matches name |474> | HTTP server named `github` | Allowed: matches name |

475> | Any server named `other` | Blocked: name doesn't match |475> | Any server named `other` | Blocked: name doesn't match |

476 476 

477> **Allowlist with denylist override**477> [accordion] Allowlist with denylist override

478>478>

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

480> {480> {

mcp.md +35 −35

Details

1039 1039 

1040The tabs cover both commands: `claude mcp add` takes your client ID and callback port as flags, and `claude mcp add-json` takes them in an `oauth` object. If you registered a redirect URI, set the callback port to the port in that URI.1040The tabs cover both commands: `claude mcp add` takes your client ID and callback port as flags, and `claude mcp add-json` takes them in an `oauth` object. If you registered a redirect URI, set the callback port to the port in that URI.

1041 1041 

1042**claude mcp add**1042> [tab] claude mcp add

1043 1043>

1044Use `--client-id` to pass your app's client ID. The `--client-secret` flag prompts for the secret with masked input:1044> Use `--client-id` to pass your app's client ID. The `--client-secret` flag prompts for the secret with masked input:

1045 1045>

1046```bash theme={null}1046> ```bash theme={null}

1047claude mcp add --transport http \1047> claude mcp add --transport http \

1048 --client-id your-client-id --client-secret --callback-port 8080 \1048> --client-id your-client-id --client-secret --callback-port 8080 \

1049 my-server https://mcp.example.com/mcp1049> my-server https://mcp.example.com/mcp

1050```1050> ```

1051 

1052**claude mcp add-json**

1053 

1054Include the `oauth` object in the JSON config and pass `--client-secret` as a separate flag:

1055 

1056```bash theme={null}

1057claude mcp add-json my-server \

1058 '{"type":"http","url":"https://mcp.example.com/mcp","oauth":{"clientId":"your-client-id","callbackPort":8080}}' \

1059 --client-secret

1060```

1061 

1062**claude mcp add-json (callback port only)**

1063 

1064To fix only the callback port and let Claude Code register the client automatically, set `callbackPort` on its own:

1065 

1066```bash theme={null}

1067claude mcp add-json my-server \

1068 '{"type":"http","url":"https://mcp.example.com/mcp","oauth":{"callbackPort":8080}}'

1069```

1070 1051 

1071**CI / env var**1052> [tab] claude mcp add-json

1053>

1054> Include the `oauth` object in the JSON config and pass `--client-secret` as a separate flag:

1055>

1056> ```bash theme={null}

1057> claude mcp add-json my-server \

1058> '{"type":"http","url":"https://mcp.example.com/mcp","oauth":{"clientId":"your-client-id","callbackPort":8080}}' \

1059> --client-secret

1060> ```

1072 1061 

1073Set the secret via environment variable to skip the interactive prompt:1062> [tab] claude mcp add-json (callback port only)

1063>

1064> To fix only the callback port and let Claude Code register the client automatically, set `callbackPort` on its own:

1065>

1066> ```bash theme={null}

1067> claude mcp add-json my-server \

1068> '{"type":"http","url":"https://mcp.example.com/mcp","oauth":{"callbackPort":8080}}'

1069> ```

1074 1070 

1075```bash theme={null}1071> [tab] CI / env var

1076MCP_CLIENT_SECRET=your-secret claude mcp add --transport http \1072>

1077 --client-id your-client-id --client-secret --callback-port 8080 \1073> Set the secret via environment variable to skip the interactive prompt:

1078 my-server https://mcp.example.com/mcp1074>

1079```1075> ```bash theme={null}

1076> MCP_CLIENT_SECRET=your-secret claude mcp add --transport http \

1077> --client-id your-client-id --client-secret --callback-port 8080 \

1078> my-server https://mcp.example.com/mcp

1079> ```

1080 1080 

1081**3. Authenticate in Claude Code**1081**3. Authenticate in Claude Code**

1082 1082 

Details

286 286 

287If a server doesn't connect, check its status with `/mcp` inside a session or `claude mcp list` from your shell, then match the symptom below. The `/mcp` panel also lets you reconnect or authenticate without leaving the session.287If a server doesn't connect, check its status with `/mcp` inside a session or `claude mcp list` from your shell, then match the symptom below. The `/mcp` panel also lets you reconnect or authenticate without leaving the session.

288 288 

289> **/mcp shows No MCP servers configured**289> [accordion] /mcp shows No MCP servers configured

290>290>

291> Claude Code didn't find any servers for the current directory. The most common causes:291> Claude Code didn't find any servers for the current directory. The most common causes:

292>292>


294> * You edited a configuration file at the wrong path. The correct files are `~/.claude.json` and `<project>/.mcp.json`. Claude Code doesn't read paths such as `~/.claude/.mcp.json`, `~/.claude/config/mcp.json`, `~/.claude/mcp.json`, or `%APPDATA%\Claude\mcp.json`. For user-scoped servers, run `claude mcp add --scope user`, which writes to the `mcpServers` key in `~/.claude.json`; for project-scoped servers, edit `.mcp.json` at the project root.294> * You edited a configuration file at the wrong path. The correct files are `~/.claude.json` and `<project>/.mcp.json`. Claude Code doesn't read paths such as `~/.claude/.mcp.json`, `~/.claude/config/mcp.json`, `~/.claude/mcp.json`, or `%APPDATA%\Claude\mcp.json`. For user-scoped servers, run `claude mcp add --scope user`, which writes to the `mcpServers` key in `~/.claude.json`; for project-scoped servers, edit `.mcp.json` at the project root.

295> * You wrote a malformed entry in `.mcp.json`. Claude Code skips that entry and still loads the others. Run `claude mcp list` from your shell and look for the parse warning, which names the offending field.295> * You wrote a malformed entry in `.mcp.json`. Claude Code skips that entry and still loads the others. Run `claude mcp list` from your shell and look for the parse warning, which names the offending field.

296 296 

297> **Status shows Failed to connect or Connection error**297> [accordion] Status shows Failed to connect or Connection error

298>298>

299> Both statuses mean the server didn't start or the URL didn't respond. They can also appear for HTTP servers that reject the token you configured in `headers.Authorization`; a server that wants a token you haven't configured shows `! Needs authentication` instead, covered in [Connect a server that requires sign-in](#connect-a-server-that-requires-sign-in).299> Both statuses mean the server didn't start or the URL didn't respond. They can also appear for HTTP servers that reject the token you configured in `headers.Authorization`; a server that wants a token you haven't configured shows `! Needs authentication` instead, covered in [Connect a server that requires sign-in](#connect-a-server-that-requires-sign-in).

300>300>


334> Run `claude mcp get <name>` and confirm the command shown there matches what you just ran. If the command shown differs from what you typed, you likely omitted the `--` separator before the server command. Remove the server and re-add it with `--` in place. If you wrote `.mcp.json` by hand, check its syntax and location. Before v2.1.285, `claude mcp get` printed no `Command` line for a stdio entry saved without a `type` field, such as a hand-written `.mcp.json` entry. On those versions, run `claude mcp list` instead, which prints the command line either way.334> Run `claude mcp get <name>` and confirm the command shown there matches what you just ran. If the command shown differs from what you typed, you likely omitted the `--` separator before the server command. Remove the server and re-add it with `--` in place. If you wrote `.mcp.json` by hand, check its syntax and location. Before v2.1.285, `claude mcp get` printed no `Command` line for a stdio entry saved without a `type` field, such as a hand-written `.mcp.json` entry. On those versions, run `claude mcp list` instead, which prints the command line either way.

335> * The command errors: the message names what's missing, such as Node.js or a browser.335> * The command errors: the message names what's missing, such as Node.js or a browser.

336 336 

337> **Connection timed out at startup**337> [accordion] Connection timed out at startup

338>338>

339> The server took longer than the default 30-second startup timeout. A stdio server's first run can be slow while `npx` downloads the package. Increase the limit with the [`MCP_TIMEOUT`](https://code.claude.com/docs/en/env-vars) environment variable, in milliseconds:339> The server took longer than the default 30-second startup timeout. A stdio server's first run can be slow while `npx` downloads the package. Increase the limit with the [`MCP_TIMEOUT`](https://code.claude.com/docs/en/env-vars) environment variable, in milliseconds:

340>340>


350>350>

351> Before v2.1.299, some connections to HTTP servers that were up timed out at startup regardless of `MCP_TIMEOUT`. If you use one of those versions and an HTTP server that is up still times out after you raise the limit, [update Claude Code](https://code.claude.com/docs/en/setup.md#update-claude-code).351> Before v2.1.299, some connections to HTTP servers that were up timed out at startup regardless of `MCP_TIMEOUT`. If you use one of those versions and an HTTP server that is up still times out after you raise the limit, [update Claude Code](https://code.claude.com/docs/en/setup.md#update-claude-code).

352 352 

353> **Server already exists**353> [accordion] Server already exists

354>354>

355> You've already added a server with that name at the same scope. Either remove the existing entry first or choose a different name:355> You've already added a server with that name at the same scope. Either remove the existing entry first or choose a different name:

356>356>


360>360>

361> If the name exists at more than one scope, `remove` reports `exists in multiple scopes`. Pass `--scope` to choose which copy to delete, for example `claude mcp remove claude-code-docs --scope local`.361> If the name exists at more than one scope, `remove` reports `exists in multiple scopes`. Pass `--scope` to choose which copy to delete, for example `claude mcp remove claude-code-docs --scope local`.

362 362 

363> **Server connects but no tools appear**363> [accordion] Server connects but no tools appear

364>364>

365> Run `/mcp` inside a session and select the server to see its tool list. If the list is empty, the server started but didn't register any tools, which usually means it's missing a required environment variable such as an API key.365> Run `/mcp` inside a session and select the server to see its tool list. If the list is empty, the server started but didn't register any tools, which usually means it's missing a required environment variable such as an API key.

366>366>


368>368>

369> Before v2.1.302, `/mcp` showed the status `tools fetch failed` for a server using [protocol revision 2026-07-28](https://code.claude.com/docs/en/mcp.md#mcp-client-runtimes) that left `resultType`, `ttlMs`, or `cacheScope` out of its replies. If you use one of those versions and a server shows that status, [update Claude Code](https://code.claude.com/docs/en/setup.md#update-claude-code).369> Before v2.1.302, `/mcp` showed the status `tools fetch failed` for a server using [protocol revision 2026-07-28](https://code.claude.com/docs/en/mcp.md#mcp-client-runtimes) that left `resultType`, `ttlMs`, or `cacheScope` out of its replies. If you use one of those versions and a server shows that status, [update Claude Code](https://code.claude.com/docs/en/setup.md#update-claude-code).

370 370 

371> **Changes to .mcp.json don't take effect**371> [accordion] Changes to .mcp.json don't take effect

372>372>

373> Claude Code reads `.mcp.json` at session start. Exit and restart the session after editing the file.373> Claude Code reads `.mcp.json` at session start. Exit and restart the session after editing the file.

374>374>


380> claude mcp reset-project-choices380> claude mcp reset-project-choices

381> ```381> ```

382 382 

383> **OAuth sign-in fails or browser doesn't open**383> [accordion] OAuth sign-in fails or browser doesn't open

384>384>

385> Run `/mcp`, select the server, and choose `Authenticate` again. If the browser doesn't open automatically, copy the URL shown in the terminal and open it manually. See [Authenticate with remote MCP servers](https://code.claude.com/docs/en/mcp.md#authenticate-with-remote-mcp-servers) for fixed callback ports and pre-configured credentials.385> Run `/mcp`, select the server, and choose `Authenticate` again. If the browser doesn't open automatically, copy the URL shown in the terminal and open it manually. See [Authenticate with remote MCP servers](https://code.claude.com/docs/en/mcp.md#authenticate-with-remote-mcp-servers) for fixed callback ports and pre-configured credentials.

386 386 

mobile.md +2 −2

Details

39| [Cloud sessions](https://code.claude.com/docs/en/claude-code-on-the-web.md) | A session on cloud infrastructure, Anthropic-managed by default | Your repository is on GitHub and the task should keep running after you put your phone away. See the [cloud quickstart](https://code.claude.com/docs/en/web-quickstart.md) to set up. |39| [Cloud sessions](https://code.claude.com/docs/en/claude-code-on-the-web.md) | A session on cloud infrastructure, Anthropic-managed by default | Your repository is on GitHub and the task should keep running after you put your phone away. See the [cloud quickstart](https://code.claude.com/docs/en/web-quickstart.md) to set up. |

40| [Projects](https://code.claude.com/docs/en/claude-projects.md) | A conversation where Claude coordinates parallel threads of work and reports back | You have a stream of related work rather than one task and want to see which threads finished or need you. |40| [Projects](https://code.claude.com/docs/en/claude-projects.md) | A conversation where Claude coordinates parallel threads of work and reports back | You have a stream of related work rather than one task and want to see which threads finished or need you. |

41| [Remote Control](https://code.claude.com/docs/en/remote-control.md) | A Claude Code session running on your computer | The work needs your local filesystem, tools, or MCP servers. |41| [Remote Control](https://code.claude.com/docs/en/remote-control.md) | A Claude Code session running on your computer | The work needs your local filesystem, tools, or MCP servers. |

42| [Dispatch](https://code.claude.com/docs/en/desktop.md#sessions-from-dispatch) | The Desktop app on your computer | You want to message a task and let Dispatch decide how to run it. Requires a Pro or Max plan. |42| [Dispatch](https://code.claude.com/docs/en/desktop.md#sessions-from-dispatch) | The Desktop app on your computer | You want to message a task and let Dispatch decide how to run it. Requires a Pro, Max, or Ultra plan. |

43 43 

44If your computer will be off, use cloud sessions or a project, which run in the cloud and continue with your laptop closed. Remote Control and Dispatch drive your own machine, so it needs to stay on with Claude Code or the Desktop app running. If your machine sleeps during a Remote Control session, Claude Code reconnects when the machine comes back online.44If your computer will be off, use cloud sessions or a project, which run in the cloud and continue with your laptop closed. Remote Control and Dispatch drive your own machine, so it needs to stay on with Claude Code or the Desktop app running. If your machine sleeps during a Remote Control session, Claude Code reconnects when the machine comes back online.

45 45 


76 76 

77* **Local-only commands**: commands that only run in the terminal interface, such as `/plugin` and `/resume`, don't work from the app. The [Remote Control limitations](https://code.claude.com/docs/en/remote-control.md#limitations) list the commands that do work from mobile and how their behavior differs.77* **Local-only commands**: commands that only run in the terminal interface, such as `/plugin` and `/resume`, don't work from the app. The [Remote Control limitations](https://code.claude.com/docs/en/remote-control.md#limitations) list the commands that do work from mobile and how their behavior differs.

78* **Permission modes**: cloud sessions offer Accept edits, Plan, and Auto, and Remote Control sessions offer Manual, Accept edits, Plan, and Auto. You can't select Bypass permissions from the app in either case. See [switch permission modes](https://code.claude.com/docs/en/permission-modes.md#switch-permission-modes) for when Auto is available.78* **Permission modes**: cloud sessions offer Accept edits, Plan, and Auto, and Remote Control sessions offer Manual, Accept edits, Plan, and Auto. You can't select Bypass permissions from the app in either case. See [switch permission modes](https://code.claude.com/docs/en/permission-modes.md#switch-permission-modes) for when Auto is available.

79* **Dispatch plans**: Dispatch requires a Pro or Max plan and isn't available on Team or Enterprise.79* **Dispatch plans**: Dispatch requires a Pro, Max, or Ultra plan and isn't available on Team or Enterprise.

80 80 

81## Related resources81## Related resources

82 82 

model-config.md +4 −4

Details

455 455 

456The behavior of `default` depends on your account type:456The behavior of `default` depends on your account type:

457 457 

458* **Pro, Max, Team, Enterprise, and Anthropic API**: defaults to Opus 5.5458* **Pro, Max, Ultra, Team, Enterprise, and Anthropic API**: defaults to Opus 5.5

459* **Claude Platform on AWS, Amazon Bedrock, and Google Cloud's Agent Platform**: defaults to Opus 5.5459* **Claude Platform on AWS, Amazon Bedrock, and Google Cloud's Agent Platform**: defaults to Opus 5.5

460* **Microsoft Foundry**: defaults to Sonnet 4.5460* **Microsoft Foundry**: defaults to Sonnet 4.5

461 461 

462Before v2.1.280, `default` resolved to Sonnet 5 on Pro and Team Standard, and to Opus 5 on Max, Team Premium, Enterprise, the Anthropic API, Claude Platform on AWS, Amazon Bedrock, and Google Cloud's Agent Platform from v2.1.219. Before v2.1.219, `default` resolved to Opus 4.8 on the Anthropic API, Max, Team Premium, and Enterprise pay-as-you-go from v2.1.154, and on Claude Platform on AWS, Amazon Bedrock, and Google Cloud's Agent Platform from v2.1.207. Before v2.1.207, `default` resolved to Opus 4.7 on Claude Platform on AWS and to Sonnet 4.5 on Amazon Bedrock and Google Cloud's Agent Platform.462Before v2.1.280, `default` resolved to Sonnet 5 on Pro and Team Standard, and to Opus 5 on Max, Ultra, Team Premium, Enterprise, the Anthropic API, Claude Platform on AWS, Amazon Bedrock, and Google Cloud's Agent Platform from v2.1.219. Before v2.1.219, `default` resolved to Opus 4.8 on the Anthropic API, Max, Ultra, Team Premium, and Enterprise pay-as-you-go from v2.1.154, and on Claude Platform on AWS, Amazon Bedrock, and Google Cloud's Agent Platform from v2.1.207. Before v2.1.207, `default` resolved to Opus 4.7 on Claude Platform on AWS and to Sonnet 4.5 on Amazon Bedrock and Google Cloud's Agent Platform.

463 463 

464When an admin has set an [organization default model](#organization-default-model), `default` resolves to that model instead of the account-type default above. Requires Claude Code v2.1.196 or later. `default` can also resolve to the model you set with [`ANTHROPIC_DEFAULT_MODEL`](#set-a-default-model-for-new-sessions), under the conditions listed in its section, or to the model [recorded on your account](#setting-your-model).464When an admin has set an [organization default model](#organization-default-model), `default` resolves to that model instead of the account-type default above. Requires Claude Code v2.1.196 or later. `default` can also resolve to the model you set with [`ANTHROPIC_DEFAULT_MODEL`](#set-a-default-model-for-new-sessions), under the conditions listed in its section, or to the model [recorded on your account](#setting-your-model).

465 465 


758 758 

759Fable 5.1, Fable 5, Sonnet 5 and later, Haiku 5.5, and Opus 4.7 and later run with the 1M window by default, with no `[1m]` suffix needed. That includes sessions on Amazon Bedrock, Google Cloud's Agent Platform, and Microsoft Foundry, and [Claude apps gateway](https://code.claude.com/docs/en/claude-apps-gateway) sessions. To run them with a 200K window instead, see [Turn off 1M context](#turn-off-1m-context).759Fable 5.1, Fable 5, Sonnet 5 and later, Haiku 5.5, and Opus 4.7 and later run with the 1M window by default, with no `[1m]` suffix needed. That includes sessions on Amazon Bedrock, Google Cloud's Agent Platform, and Microsoft Foundry, and [Claude apps gateway](https://code.claude.com/docs/en/claude-apps-gateway) sessions. To run them with a 200K window instead, see [Turn off 1M context](#turn-off-1m-context).

760 760 

761Opus 4.6 and Sonnet 4.6 reach 1M only through their `[1m]` variant, and access to that variant depends on your plan. On Max, Team, and Enterprise plans, including both Team Standard and Team Premium seats, Opus 4.6 with 1M context is included with your subscription. Sonnet 4.6 with 1M context requires [usage credits](https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans) on every subscription plan, including Max.761Opus 4.6 and Sonnet 4.6 reach 1M only through their `[1m]` variant, and access to that variant depends on your plan. On Max, Ultra, Team, and Enterprise plans, including both Team Standard and Team Premium seats, Opus 4.6 with 1M context is included with your subscription. Sonnet 4.6 with 1M context requires [usage credits](https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans) on every subscription plan, including Max and Ultra.

762 762 

763| Plan | Opus 4.6 with 1M context | Sonnet 4.6 with 1M context |763| Plan | Opus 4.6 with 1M context | Sonnet 4.6 with 1M context |

764| - | - | - |764| - | - | - |

765| Max, Team, and Enterprise | Included with subscription | Requires [usage credits](https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans) |765| Max, Ultra, Team, and Enterprise | Included with subscription | Requires [usage credits](https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans) |

766| Pro | Requires [usage credits](https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans) | Requires [usage credits](https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans) |766| Pro | Requires [usage credits](https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans) | Requires [usage credits](https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans) |

767| API and pay-as-you-go | Full access | Full access |767| API and pay-as-you-go | Full access | Full access |

768 768 

overview.md +119 −119

Details

12 12 

13Claude Code runs on several surfaces: the terminal, IDE extensions, a desktop app, and the web. Choose one from the tabs below to get started. Most surfaces require a [Claude subscription](https://claude.com/pricing?utm_source=claude_code\&utm_medium=docs\&utm_content=overview_pricing) or [Anthropic Console](https://platform.claude.com/) account. The Terminal CLI, VS Code, and JetBrains also support [third-party providers](https://code.claude.com/docs/en/third-party-integrations.md).13Claude Code runs on several surfaces: the terminal, IDE extensions, a desktop app, and the web. Choose one from the tabs below to get started. Most surfaces require a [Claude subscription](https://claude.com/pricing?utm_source=claude_code\&utm_medium=docs\&utm_content=overview_pricing) or [Anthropic Console](https://platform.claude.com/) account. The Terminal CLI, VS Code, and JetBrains also support [third-party providers](https://code.claude.com/docs/en/third-party-integrations.md).

14 14 

15**Terminal**15> [tab] Terminal

16 16>

17The full-featured CLI for working with Claude Code directly in your terminal. Edit files, run commands, and manage your entire project from the command line.17> The full-featured CLI for working with Claude Code directly in your terminal. Edit files, run commands, and manage your entire project from the command line.

18 18>

19To install Claude Code, open a terminal and run the command for your system. If you haven't used a terminal before, the [terminal guide](https://code.claude.com/docs/en/terminal-guide) shows how to open one and paste the command.19> To install Claude Code, open a terminal and run the command for your system. If you haven't used a terminal before, the [terminal guide](https://code.claude.com/docs/en/terminal-guide) shows how to open one and paste the command.

20 20>

21**Native Install (Recommended)**21> > [tab] Native Install (Recommended)

22 22> >

23**macOS, Linux, WSL:**23> > **macOS, Linux, WSL:**

24 24> >

25```bash theme={null}25> > ```bash theme={null}

26curl -fsSL https://claude.ai/install.sh | bash26> > curl -fsSL https://claude.ai/install.sh | bash

27```27> > ```

28 28> >

29On Windows, your prompt shows `PS C:\` when you're in PowerShell and `C:\` without the `PS` when you're in CMD.29> > On Windows, your prompt shows `PS C:\` when you're in PowerShell and `C:\` without the `PS` when you're in CMD.

30 30> >

31**Windows PowerShell:**31> > **Windows PowerShell:**

32 32> >

33```powershell theme={null}33> > ```powershell theme={null}

34irm https://claude.ai/install.ps1 | iex34> > irm https://claude.ai/install.ps1 | iex

35```35> > ```

36 36> >

37**Windows CMD:**37> > **Windows CMD:**

38 38> >

39```batch theme={null}39> > ```batch theme={null}

40curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd40> > curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd

41```41> > ```

42 42> >

43The install command shows no progress while it downloads Claude Code. When the installer finishes, open a new terminal window and run `claude --version`. A working installation prints a version number. If your shell says `claude` isn't found or isn't recognized, the install directory isn't on your PATH yet: see [Fix your PATH](https://code.claude.com/docs/en/troubleshoot-install.md#command-not-found-claude-after-installation).43> > The install command shows no progress while it downloads Claude Code. When the installer finishes, open a new terminal window and run `claude --version`. A working installation prints a version number. If your shell says `claude` isn't found or isn't recognized, the install directory isn't on your PATH yet: see [Fix your PATH](https://code.claude.com/docs/en/troubleshoot-install.md#command-not-found-claude-after-installation).

44 44> >

45If you see `The token '&&' is not a valid statement separator`, you're in PowerShell, not CMD. If you see `'irm' is not recognized as an internal or external command`, you're in CMD, not PowerShell.45> > If you see `The token '&&' is not a valid statement separator`, you're in PowerShell, not CMD. If you see `'irm' is not recognized as an internal or external command`, you're in CMD, not PowerShell.

46 46> >

47If the install command fails with `syntax error near unexpected token '<'`, a `403`, or any other error, see [Troubleshoot installation](https://code.claude.com/docs/en/troubleshoot-install.md#find-your-error) to match the error to a fix and for alternative install methods.47> > If the install command fails with `syntax error near unexpected token '<'`, a `403`, or any other error, see [Troubleshoot installation](https://code.claude.com/docs/en/troubleshoot-install.md#find-your-error) to match the error to a fix and for alternative install methods.

48 48> >

49[Git for Windows](https://git-scm.com/downloads/win) is recommended on native Windows so Claude Code can use the Bash tool. If Git for Windows is not installed, Claude Code uses PowerShell as the shell tool instead. WSL setups do not need Git for Windows.49> > [Git for Windows](https://git-scm.com/downloads/win) is recommended on native Windows so Claude Code can use the Bash tool. If Git for Windows is not installed, Claude Code uses PowerShell as the shell tool instead. WSL setups do not need Git for Windows.

50 50> >

51> [!NOTE]51> > > [!NOTE]

52> > >

53> > > Native installations automatically update in the background to keep you on the latest version.

54>

55> > [tab] Homebrew

56> >

57> > ```bash theme={null}

58> > brew install --cask claude-code

59> > ```

60> >

61> > Homebrew offers two casks. `claude-code` tracks the stable release channel, which is typically about a week behind and skips releases with major regressions. `claude-code@latest` tracks the latest channel and receives new versions as soon as they ship.

62> >

63> > > [!NOTE]

64> > >

65> > > Homebrew installations do not auto-update. Run `brew upgrade claude-code` or `brew upgrade claude-code@latest`, depending on which cask you installed, to get the latest features and security fixes.

66>

67> > [tab] WinGet

68> >

69> > ```powershell theme={null}

70> > winget install Anthropic.ClaudeCode

71> > ```

72> >

73> > > [!NOTE]

74> > >

75> > > WinGet installations do not auto-update. Run `winget upgrade Anthropic.ClaudeCode` periodically to get the latest features and security fixes.

76>

77> You can also install with [apt, dnf, or apk](https://code.claude.com/docs/en/setup.md#install-with-linux-package-managers) on Debian, Fedora, RHEL, and Alpine.

78>

79> Then start Claude Code in any project. Replace `your-project` with the path to a project directory on your machine:

52>80>

53> Native installations automatically update in the background to keep you on the latest version.81> ```bash theme={null}

54 82> cd your-project

55**Homebrew**83> claude

56 84> ```

57```bash theme={null}

58brew install --cask claude-code

59```

60 

61Homebrew offers two casks. `claude-code` tracks the stable release channel, which is typically about a week behind and skips releases with major regressions. `claude-code@latest` tracks the latest channel and receives new versions as soon as they ship.

62 

63> [!NOTE]

64>85>

65> Homebrew installations do not auto-update. Run `brew upgrade claude-code` or `brew upgrade claude-code@latest`, depending on which cask you installed, to get the latest features and security fixes.86> Claude Code prompts you to log in on first use. If you've set the `ANTHROPIC_API_KEY` environment variable and you approve the key when Claude Code asks whether to use it, Claude Code skips the login prompt. [Continue with the Quickstart →](https://code.claude.com/docs/en/quickstart.md)

66 

67**WinGet**

68 

69```powershell theme={null}

70winget install Anthropic.ClaudeCode

71```

72 

73> [!NOTE]

74>87>

75> WinGet installations do not auto-update. Run `winget upgrade Anthropic.ClaudeCode` periodically to get the latest features and security fixes.88> > [!TIP]

76 89> >

77You can also install with [apt, dnf, or apk](https://code.claude.com/docs/en/setup.md#install-with-linux-package-managers) on Debian, Fedora, RHEL, and Alpine.90> > See [advanced setup](https://code.claude.com/docs/en/setup.md) for installation options, manual updates, or uninstallation instructions. Visit [installation troubleshooting](https://code.claude.com/docs/en/troubleshoot-install.md) if you hit issues.

78 

79Then start Claude Code in any project. Replace `your-project` with the path to a project directory on your machine:

80 91 

81```bash theme={null}92> [tab] VS Code

82cd your-project

83claude

84```

85 

86Claude Code prompts you to log in on first use. If you've set the `ANTHROPIC_API_KEY` environment variable and you approve the key when Claude Code asks whether to use it, Claude Code skips the login prompt. [Continue with the Quickstart →](https://code.claude.com/docs/en/quickstart.md)

87 

88> [!TIP]

89>93>

90> See [advanced setup](https://code.claude.com/docs/en/setup.md) for installation options, manual updates, or uninstallation instructions. Visit [installation troubleshooting](https://code.claude.com/docs/en/troubleshoot-install.md) if you hit issues.94> The VS Code extension provides inline diffs, @-mentions, plan review, and conversation history directly in your editor.

91 95>

92**VS Code**96> * [Install for VS Code](vscode:extension/anthropic.claude-code)

93 97> * [Install for Cursor](cursor:extension/anthropic.claude-code)

94The VS Code extension provides inline diffs, @-mentions, plan review, and conversation history directly in your editor.98>

95 99> Or search for "Claude Code" in the Extensions view (`Cmd+Shift+X` on Mac, `Ctrl+Shift+X` on Windows/Linux). After installing, open the Command Palette (`Cmd+Shift+P` / `Ctrl+Shift+P`), type "Claude Code", and select **Open in New Tab**.

96* [Install for VS Code](vscode:extension/anthropic.claude-code)100>

97* [Install for Cursor](cursor:extension/anthropic.claude-code)101> [Get started with VS Code →](https://code.claude.com/docs/en/vs-code.md#get-started)

98 

99Or search for "Claude Code" in the Extensions view (`Cmd+Shift+X` on Mac, `Ctrl+Shift+X` on Windows/Linux). After installing, open the Command Palette (`Cmd+Shift+P` / `Ctrl+Shift+P`), type "Claude Code", and select **Open in New Tab**.

100 

101[Get started with VS Code →](https://code.claude.com/docs/en/vs-code.md#get-started)

102 

103**Desktop app**

104 

105A standalone app for running Claude Code outside your IDE or terminal. Review diffs visually, run multiple sessions side by side, schedule recurring tasks, and start cloud sessions.

106 

107Download and install:

108 

109* [macOS](https://claude.ai/api/desktop/darwin/universal/dmg/latest/redirect?utm_source=claude_code\&utm_medium=docs) (Intel and Apple Silicon)

110* [Windows](https://claude.ai/api/desktop/win32/x64/setup/latest/redirect?utm_source=claude_code\&utm_medium=docs) (x64)

111* [Windows ARM64](https://claude.ai/api/desktop/win32/arm64/setup/latest/redirect?utm_source=claude_code\&utm_medium=docs)

112* On Ubuntu or Debian, where the app is in beta, install it with apt by following the [Linux install instructions](https://code.claude.com/docs/en/desktop-linux.md)

113 

114After installing, launch Claude, sign in, and click the **Code** tab to start coding. The app includes Claude Code, so you don't need to install the CLI separately. A [paid subscription](https://claude.com/pricing?utm_source=claude_code\&utm_medium=docs\&utm_content=overview_desktop_pricing) is required.

115 

116[Learn more about the desktop app →](https://code.claude.com/docs/en/desktop-quickstart.md)

117 

118**Web**

119 

120Run Claude Code in your browser with no local setup. Kick off long-running tasks and check back when they're done, work on repos you don't have locally, or run multiple tasks in parallel. For a longer body of work, create a [project](https://code.claude.com/docs/en/claude-projects.md) and let Claude coordinate the parallel sessions for you. Available on desktop browsers and [the Claude app for iOS and Android](https://code.claude.com/docs/en/mobile.md).

121 

122Start coding at [claude.ai/code](https://claude.ai/code).

123 

124[Get started →](https://code.claude.com/docs/en/web-quickstart.md)

125 

126**JetBrains**

127 102 

128A plugin for IntelliJ IDEA, PyCharm, WebStorm, and other JetBrains IDEs with interactive diff viewing and selection context sharing.103> [tab] Desktop app

104>

105> A standalone app for running Claude Code outside your IDE or terminal. Review diffs visually, run multiple sessions side by side, schedule recurring tasks, and start cloud sessions.

106>

107> Download and install:

108>

109> * [macOS](https://claude.ai/api/desktop/darwin/universal/dmg/latest/redirect?utm_source=claude_code\&utm_medium=docs) (Intel and Apple Silicon)

110> * [Windows](https://claude.ai/api/desktop/win32/x64/setup/latest/redirect?utm_source=claude_code\&utm_medium=docs) (x64)

111> * [Windows ARM64](https://claude.ai/api/desktop/win32/arm64/setup/latest/redirect?utm_source=claude_code\&utm_medium=docs)

112> * On Ubuntu or Debian, where the app is in beta, install it with apt by following the [Linux install instructions](https://code.claude.com/docs/en/desktop-linux.md)

113>

114> After installing, launch Claude, sign in, and click the **Code** tab to start coding. The app includes Claude Code, so you don't need to install the CLI separately. A [paid subscription](https://claude.com/pricing?utm_source=claude_code\&utm_medium=docs\&utm_content=overview_desktop_pricing) is required.

115>

116> [Learn more about the desktop app →](https://code.claude.com/docs/en/desktop-quickstart.md)

129 117 

130Install the [Claude Code plugin](https://plugins.jetbrains.com/plugin/27310-claude-code-beta-) from the JetBrains Marketplace and restart your IDE. The plugin requires the Claude Code CLI, installed separately; see the [JetBrains setup steps](https://code.claude.com/docs/en/jetbrains.md#installation).118> [tab] Web

119>

120> Run Claude Code in your browser with no local setup. Kick off long-running tasks and check back when they're done, work on repos you don't have locally, or run multiple tasks in parallel. For a longer body of work, create a [project](https://code.claude.com/docs/en/claude-projects.md) and let Claude coordinate the parallel sessions for you. Available on desktop browsers and [the Claude app for iOS and Android](https://code.claude.com/docs/en/mobile.md).

121>

122> Start coding at [claude.ai/code](https://claude.ai/code).

123>

124> [Get started →](https://code.claude.com/docs/en/web-quickstart.md)

131 125 

132[Get started with JetBrains →](https://code.claude.com/docs/en/jetbrains.md)126> [tab] JetBrains

127>

128> A plugin for IntelliJ IDEA, PyCharm, WebStorm, and other JetBrains IDEs with interactive diff viewing and selection context sharing.

129>

130> Install the [Claude Code plugin](https://plugins.jetbrains.com/plugin/27310-claude-code-beta-) from the JetBrains Marketplace and restart your IDE. The plugin requires the Claude Code CLI, installed separately; see the [JetBrains setup steps](https://code.claude.com/docs/en/jetbrains.md#installation).

131>

132> [Get started with JetBrains →](https://code.claude.com/docs/en/jetbrains.md)

133 133 

134## What you can do134## What you can do

135 135 

136Here are some of the ways you can use Claude Code:136Here are some of the ways you can use Claude Code:

137 137 

138> **Automate the work you keep putting off**138> [accordion] Automate the work you keep putting off

139>139>

140> Claude Code handles the tedious tasks that eat up your day: writing tests for untested code, fixing lint errors across a project, resolving merge conflicts, updating dependencies, and writing release notes.140> Claude Code handles the tedious tasks that eat up your day: writing tests for untested code, fixing lint errors across a project, resolving merge conflicts, updating dependencies, and writing release notes.

141>141>


143> claude "write tests for the auth module, run them, and fix any failures"143> claude "write tests for the auth module, run them, and fix any failures"

144> ```144> ```

145 145 

146> **Build features and fix bugs**146> [accordion] Build features and fix bugs

147>147>

148> Describe what you want in plain language. Claude Code plans the approach, writes the code across multiple files, and verifies it works.148> Describe what you want in plain language. Claude Code plans the approach, writes the code across multiple files, and verifies it works.

149>149>

150> For bugs, paste an error message or describe the symptom. Claude Code traces the issue through your codebase, identifies the root cause, and implements a fix. See [common workflows](https://code.claude.com/docs/en/common-workflows.md) for more examples.150> For bugs, paste an error message or describe the symptom. Claude Code traces the issue through your codebase, identifies the root cause, and implements a fix. See [common workflows](https://code.claude.com/docs/en/common-workflows.md) for more examples.

151 151 

152> **Create commits and pull requests**152> [accordion] Create commits and pull requests

153>153>

154> Claude Code works directly with git. It stages changes, writes commit messages, creates branches, and opens pull requests.154> Claude Code works directly with git. It stages changes, writes commit messages, creates branches, and opens pull requests.

155>155>


159>159>

160> In CI, you can automate code review and issue triage with [GitHub Actions](https://code.claude.com/docs/en/github-actions.md) or [GitLab CI/CD](https://code.claude.com/docs/en/gitlab-ci-cd.md).160> In CI, you can automate code review and issue triage with [GitHub Actions](https://code.claude.com/docs/en/github-actions.md) or [GitLab CI/CD](https://code.claude.com/docs/en/gitlab-ci-cd.md).

161 161 

162> **Connect your tools with MCP**162> [accordion] Connect your tools with MCP

163>163>

164> The [Model Context Protocol (MCP)](https://code.claude.com/docs/en/mcp.md) is an open standard for connecting AI tools to external data sources. With MCP, Claude Code can read your design docs in Google Drive, update tickets in Jira, pull data from Slack, or use your own custom tooling. The [MCP quickstart](https://code.claude.com/docs/en/mcp-quickstart.md) connects your first server end to end.164> The [Model Context Protocol (MCP)](https://code.claude.com/docs/en/mcp.md) is an open standard for connecting AI tools to external data sources. With MCP, Claude Code can read your design docs in Google Drive, update tickets in Jira, pull data from Slack, or use your own custom tooling. The [MCP quickstart](https://code.claude.com/docs/en/mcp-quickstart.md) connects your first server end to end.

165 165 

166> **Customize with instructions, skills, and hooks**166> [accordion] Customize with instructions, skills, and hooks

167>167>

168> [`CLAUDE.md`](https://code.claude.com/docs/en/memory) is a markdown file you add to your project root that Claude Code reads at the start of every session. Use it to set coding standards, architecture decisions, preferred libraries, and review checklists. If your repository already has an `AGENTS.md` for other coding agents, Claude Code [can read that](https://code.claude.com/docs/en/memory.md#agents-md) in place of a `CLAUDE.md`. Claude also builds [auto memory](https://code.claude.com/docs/en/memory.md#auto-memory) as it works, saving learnings across sessions without you writing anything.168> [`CLAUDE.md`](https://code.claude.com/docs/en/memory) is a markdown file you add to your project root that Claude Code reads at the start of every session. Use it to set coding standards, architecture decisions, preferred libraries, and review checklists. If your repository already has an `AGENTS.md` for other coding agents, Claude Code [can read that](https://code.claude.com/docs/en/memory.md#agents-md) in place of a `CLAUDE.md`. Claude also builds [auto memory](https://code.claude.com/docs/en/memory.md#auto-memory) as it works, saving learnings across sessions without you writing anything.

169>169>


171>171>

172> [Hooks](https://code.claude.com/docs/en/hooks.md) let you run shell commands before or after Claude Code actions, like auto-formatting after every file edit or running lint before a commit.172> [Hooks](https://code.claude.com/docs/en/hooks.md) let you run shell commands before or after Claude Code actions, like auto-formatting after every file edit or running lint before a commit.

173 173 

174> **Run agents in parallel and build custom agents**174> [accordion] Run agents in parallel and build custom agents

175>175>

176> Spawn [multiple Claude Code agents](https://code.claude.com/docs/en/sub-agents.md) that work on different parts of a task simultaneously. A lead agent coordinates the work, assigns subtasks, and merges results.176> Spawn [multiple Claude Code agents](https://code.claude.com/docs/en/sub-agents.md) that work on different parts of a task simultaneously. A lead agent coordinates the work, assigns subtasks, and merges results.

177>177>

178> To run several full sessions in parallel and watch them from one screen, use [background agents](https://code.claude.com/docs/en/agent-view.md). For fully custom workflows, the [Agent SDK](https://code.claude.com/docs/en/agent-sdk/overview.md) lets you build your own agents powered by Claude Code's tools and capabilities, with full control over orchestration, tool access, and permissions.178> To run several full sessions in parallel and watch them from one screen, use [background agents](https://code.claude.com/docs/en/agent-view.md). For fully custom workflows, the [Agent SDK](https://code.claude.com/docs/en/agent-sdk/overview.md) lets you build your own agents powered by Claude Code's tools and capabilities, with full control over orchestration, tool access, and permissions.

179 179 

180> **Pipe, script, and automate with the CLI**180> [accordion] Pipe, script, and automate with the CLI

181>181>

182> Claude Code is composable and follows the Unix philosophy. Pipe logs into it, run it in CI, or chain it with other tools:182> Claude Code is composable and follows the Unix philosophy. Pipe logs into it, run it in CI, or chain it with other tools:

183>183>


194>194>

195> See the [CLI reference](https://code.claude.com/docs/en/cli-reference.md) for the full set of commands and flags.195> See the [CLI reference](https://code.claude.com/docs/en/cli-reference.md) for the full set of commands and flags.

196 196 

197> **Schedule recurring tasks**197> [accordion] Schedule recurring tasks

198>198>

199> Run Claude on a schedule to automate work that repeats: morning PR reviews, overnight CI failure analysis, weekly dependency audits, or syncing docs after PRs merge.199> Run Claude on a schedule to automate work that repeats: morning PR reviews, overnight CI failure analysis, weekly dependency audits, or syncing docs after PRs merge.

200>200>


202> * [Desktop scheduled tasks](https://code.claude.com/docs/en/desktop-scheduled-tasks.md) run on your machine, with direct access to your local files and tools202> * [Desktop scheduled tasks](https://code.claude.com/docs/en/desktop-scheduled-tasks.md) run on your machine, with direct access to your local files and tools

203> * [`/loop`](https://code.claude.com/docs/en/scheduled-tasks) repeats a prompt within a CLI session for quick polling203> * [`/loop`](https://code.claude.com/docs/en/scheduled-tasks) repeats a prompt within a CLI session for quick polling

204 204 

205> **Work from anywhere**205> [accordion] Work from anywhere

206>206>

207> Sessions aren't tied to a single surface. Move work between them as your context changes:207> Sessions aren't tied to a single surface. Move work between them as your context changes:

208>208>

permission-modes.md +140 −135

Details

8 8 

9A permission mode sets which actions Claude can take in a session without asking you first. In Manual mode, Claude Code stops and asks you before most actions that edit files, run shell commands, or reach the network. In [auto mode](#eliminate-prompts-with-auto-mode), a second model, the classifier, reviews actions instead of you; [how the classifier evaluates actions](#how-the-classifier-evaluates-actions) lists which actions it reviews and which skip it.9A permission mode sets which actions Claude can take in a session without asking you first. In Manual mode, Claude Code stops and asks you before most actions that edit files, run shell commands, or reach the network. In [auto mode](#eliminate-prompts-with-auto-mode), a second model, the classifier, reviews actions instead of you; [how the classifier evaluates actions](#how-the-classifier-evaluates-actions) lists which actions it reviews and which skip it.

10 10 

11With Claude Code v2.1.283 or later, auto mode is the built-in starting permission mode for interactive terminal and VS Code sessions. On earlier versions, it's the built-in starting permission mode only on Pro, Max, and Team plans. [Which mode a session starts in](#which-mode-a-session-starts-in) covers the surfaces and settings that change the starting permission mode. You can also change a running session's permission mode at any time.11With Claude Code v2.1.283 or later, auto mode is the built-in starting permission mode for interactive terminal and VS Code sessions. On earlier versions, it's the built-in starting permission mode only on Pro, Max, Ultra, and Team plans. [Which mode a session starts in](#which-mode-a-session-starts-in) covers the surfaces and settings that change the starting permission mode. You can also change a running session's permission mode at any time.

12 12 

13## Available modes13## Available modes

14 14 


80| Any settings file sets `disableAutoMode` to `"disable"` | `default` |80| Any settings file sets `disableAutoMode` to `"disable"` | `default` |

81| `claude -p` or the [Agent SDK](https://code.claude.com/docs/en/agent-sdk/permissions.md#permission-modes) | `default` |81| `claude -p` or the [Agent SDK](https://code.claude.com/docs/en/agent-sdk/permissions.md#permission-modes) | `default` |

82| Your organization has the [HIPAA configuration](#hipaa-configuration) applied and the session is [eligible for it](https://code.claude.com/docs/en/hipaa-setup.md#check-how-developers-sign-in-and-connect) | `default` with Claude Code v2.1.285 or later; auto mode stays available to switch to |82| Your organization has the [HIPAA configuration](#hipaa-configuration) applied and the session is [eligible for it](https://code.claude.com/docs/en/hipaa-setup.md#check-how-developers-sign-in-and-connect) | `default` with Claude Code v2.1.285 or later; auto mode stays available to switch to |

83| In a terminal or through the [VS Code extension](https://code.claude.com/docs/en/vs-code.md) | `auto` with Claude Code v2.1.283 or later; on earlier versions, `auto` on Pro, Max, or Team plans in sessions that [fetch feature flags](https://code.claude.com/docs/en/env-vars.md#features-that-need-feature-flag-fetching), and `default` otherwise |83| In a terminal or through the [VS Code extension](https://code.claude.com/docs/en/vs-code.md) | `auto` with Claude Code v2.1.283 or later; on earlier versions, `auto` on Pro, Max, Ultra, or Team plans in sessions that [fetch feature flags](https://code.claude.com/docs/en/env-vars.md#features-that-need-feature-flag-fetching), and `default` otherwise |

84 84 

85When the flag, a settings file, or the built-in default selects `auto` but auto mode isn't available to the session, Claude Code starts the session in Manual instead. Auto mode is unavailable when the session doesn't meet the [availability requirements](#eliminate-prompts-with-auto-mode), such as a settings file turning it off or a model that doesn't support it, or when Anthropic has temporarily turned it off server-side.85When the flag, a settings file, or the built-in default selects `auto` but auto mode isn't available to the session, Claude Code starts the session in Manual instead. Auto mode is unavailable when the session doesn't meet the [availability requirements](#eliminate-prompts-with-auto-mode), such as a settings file turning it off or a model that doesn't support it, or when Anthropic has temporarily turned it off server-side.

86 86 


89* In a terminal, once, at the top of the session89* In a terminal, once, at the top of the session

90* In the VS Code extension, as a card on the new-conversation screen that stays until you dismiss it90* In the VS Code extension, as a card on the new-conversation screen that stays until you dismiss it

91 91 

92If your `~/.claude/settings.json` sets a `defaultMode` other than `auto` and no other settings file sets one, your sessions keep starting in that mode. On Pro, Max, and Team plans, and in sessions that [don't fetch feature flags](https://code.claude.com/docs/en/env-vars.md#features-that-need-feature-flag-fetching), Claude Code asks once, in the terminal or in the VS Code extension, whether to change the setting to auto mode. If you decline, your setting stays as it is.92If your `~/.claude/settings.json` sets a `defaultMode` other than `auto` and no other settings file sets one, your sessions keep starting in that mode.

93 

94On Pro, Max, Ultra, and Team plans, and in sessions that [don't fetch feature flags](https://code.claude.com/docs/en/env-vars.md#features-that-need-feature-flag-fetching), Claude Code asks once whether to change the setting to auto mode. The question appears in the terminal or in the VS Code extension, and if you decline, your setting stays as it is.

93 95 

94### Tool calls denied in `claude -p` and Agent SDK runs96### Tool calls denied in `claude -p` and Agent SDK runs

95 97 


102 104 

103These examples show the auto mode form for the CLI and each SDK:105These examples show the auto mode form for the CLI and each SDK:

104 106 

105**CLI**107> [tab] CLI

106 108>

107```bash theme={null}109> ```bash theme={null}

108claude -p "Run the test suite and fix any failures" --permission-mode auto110> claude -p "Run the test suite and fix any failures" --permission-mode auto

109```111> ```

110 

111**TypeScript**

112 

113```typescript theme={null}

114const options = {

115 permissionMode: "auto"

116};

117```

118 

119**Python**

120 112 

121```python theme={null}113> [tab] TypeScript

122from claude_agent_sdk import ClaudeAgentOptions114>

115> ```typescript theme={null}

116> const options = {

117> permissionMode: "auto"

118> };

119> ```

123 120 

124options = ClaudeAgentOptions(permission_mode="auto")121> [tab] Python

125```122>

123> ```python theme={null}

124> from claude_agent_sdk import ClaudeAgentOptions

125>

126> options = ClaudeAgentOptions(permission_mode="auto")

127> ```

126 128 

127Before v2.1.302, these runs could start in auto mode if they didn't [fetch feature flags](https://code.claude.com/docs/en/env-vars.md#features-that-need-feature-flag-fetching), for example on a [third-party provider](https://code.claude.com/docs/en/third-party-integrations.md) or with `DISABLE_TELEMETRY`.129Before v2.1.302, these runs could start in auto mode if they didn't [fetch feature flags](https://code.claude.com/docs/en/env-vars.md#features-that-need-feature-flag-fetching), for example on a [third-party provider](https://code.claude.com/docs/en/third-party-integrations.md) or with `DISABLE_TELEMETRY`.

128 130 


166 168 

167Each interface has its own control for switching permission modes during a session and its own way of choosing the permission mode new sessions start in. Select your interface to see its controls.169Each interface has its own control for switching permission modes during a session and its own way of choosing the permission mode new sessions start in. Select your interface to see its controls.

168 170 

169**CLI**171> [tab] CLI

170 172>

171**During a session**: press `Shift+Tab` to cycle permission modes. From `auto`, the first press switches to `default`, and the cycle then runs `default` → `acceptEdits` → `plan`. Optional modes slot in after `plan`. The status bar shows the active mode as a gray `⏸ manual mode on` for `default`, or as `⏵⏵ accept edits on`, `⏸ plan mode on`, `⏵⏵ auto mode on`, `⏵⏵ don't ask on`, or `⏵⏵ bypass permissions on`.173> **During a session**: press `Shift+Tab` to cycle permission modes. From `auto`, the first press switches to `default`, and the cycle then runs `default` → `acceptEdits` → `plan`. Optional modes slot in after `plan`. The status bar shows the active mode as a gray `⏸ manual mode on` for `default`, or as `⏵⏵ accept edits on`, `⏸ plan mode on`, `⏵⏵ auto mode on`, `⏵⏵ don't ask on`, or `⏵⏵ bypass permissions on`.

172 174>

173Watch the status bar in this clip of a session that started in auto mode. Each time you press `Shift+Tab`, it changes from `auto mode on` to `manual mode on`, `accept edits on`, `plan mode on`, and back to `auto mode on`.175> Watch the status bar in this clip of a session that started in auto mode. Each time you press `Shift+Tab`, it changes from `auto mode on` to `manual mode on`, `accept edits on`, `plan mode on`, and back to `auto mode on`.

174 176>

175<video autoPlay muted loop playsInline src="https://mintcdn.com/claude-code/tA-x-5L2YsYSVdee/images/permission-modes-cycle-light.mp4?fit=max&auto=format&n=tA-x-5L2YsYSVdee&q=85&s=3927dd62d59b01efd81b3578f2a6f971" aria-label="The status bar under the Claude Code prompt changes with each press of Shift+Tab: auto mode on, manual mode on, accept edits on, plan mode on, then auto mode on again." />177> <video autoPlay muted loop playsInline src="https://mintcdn.com/claude-code/tA-x-5L2YsYSVdee/images/permission-modes-cycle-light.mp4?fit=max&auto=format&n=tA-x-5L2YsYSVdee&q=85&s=3927dd62d59b01efd81b3578f2a6f971" aria-label="The status bar under the Claude Code prompt changes with each press of Shift+Tab: auto mode on, manual mode on, accept edits on, plan mode on, then auto mode on again." />

176 178>

177Not every mode is in the default cycle:179> Not every mode is in the default cycle:

178 180>

179* `auto`: appears when [auto mode is available](#eliminate-prompts-with-auto-mode); cycling to it switches permission modes without a confirmation prompt181> * `auto`: appears when [auto mode is available](#eliminate-prompts-with-auto-mode); cycling to it switches permission modes without a confirmation prompt

180* `bypassPermissions`: appears after you start with `--permission-mode bypassPermissions`, `--dangerously-skip-permissions`, `--allow-dangerously-skip-permissions`, or `permissions.defaultMode: "bypassPermissions"` in [user, `--settings`, or managed settings](https://code.claude.com/docs/en/settings-reference#permissions-defaultmode). The `--allow-` variant adds the permission mode to the cycle without activating it182> * `bypassPermissions`: appears after you start with `--permission-mode bypassPermissions`, `--dangerously-skip-permissions`, `--allow-dangerously-skip-permissions`, or `permissions.defaultMode: "bypassPermissions"` in [user, `--settings`, or managed settings](https://code.claude.com/docs/en/settings-reference#permissions-defaultmode). The `--allow-` variant adds the permission mode to the cycle without activating it

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

182 184>

183Enabled optional modes slot in after `plan`, with `bypassPermissions` first and `auto` last. If you have both enabled, you will cycle through `bypassPermissions` on the way to `auto`.185> Enabled optional modes slot in after `plan`, with `bypassPermissions` first and `auto` last. If you have both enabled, you will cycle through `bypassPermissions` on the way to `auto`.

184 186>

185**From a Bash permission prompt**: in the Manual and `acceptEdits` permission modes, when [auto mode](#eliminate-prompts-with-auto-mode) is available, Claude Code adds **Yes, and switch to auto mode** to a Bash command's permission prompt. Select it to approve the command and switch the session to auto mode. [PowerShell tool](https://code.claude.com/docs/en/tools-reference.md#powershell-tool) prompts don't offer the option. Requires Claude Code v2.1.247 or later.187> **From a Bash permission prompt**: in the Manual and `acceptEdits` permission modes, when [auto mode](#eliminate-prompts-with-auto-mode) is available, Claude Code adds **Yes, and switch to auto mode** to a Bash command's permission prompt. Select it to approve the command and switch the session to auto mode. [PowerShell tool](https://code.claude.com/docs/en/tools-reference.md#powershell-tool) prompts don't offer the option. Requires Claude Code v2.1.247 or later.

186 188>

187Claude Code doesn't add the option to prompts forced by one of your [`ask` rules](https://code.claude.com/docs/en/permissions#manage-permissions) or by a [hook](https://code.claude.com/docs/en/hooks.md#pretooluse-decision-control), because auto mode still shows you those prompts, so switching wouldn't remove them.189> Claude Code doesn't add the option to prompts forced by one of your [`ask` rules](https://code.claude.com/docs/en/permissions#manage-permissions) or by a [hook](https://code.claude.com/docs/en/hooks.md#pretooluse-decision-control), because auto mode still shows you those prompts, so switching wouldn't remove them.

188 190>

189**At startup**: pass the permission mode as a flag.191> **At startup**: pass the permission mode as a flag.

190 192>

191```bash theme={null}193> ```bash theme={null}

192claude --permission-mode plan194> claude --permission-mode plan

193```195> ```

194 196>

195**As a default**: set `permissions.defaultMode` at the scope you want, as described in [Start in a different permission mode](#start-in-a-different-mode).197> **As a default**: set `permissions.defaultMode` at the scope you want, as described in [Start in a different permission mode](#start-in-a-different-mode).

196 198>

197The same `--permission-mode` flag works with `-p` for [non-interactive runs](https://code.claude.com/docs/en/headless.md).199> The same `--permission-mode` flag works with `-p` for [non-interactive runs](https://code.claude.com/docs/en/headless.md).

198 

199**VS Code**

200 

201**During a session**: click the mode indicator at the bottom of the prompt box. It uses these labels for the modes on this page:

202 

203| UI label | Mode |

204| :- | :- |

205| Manual | `default` |

206| Edit automatically | `acceptEdits` |

207| Plan | `plan` |

208| Auto | `auto` |

209| Bypass permissions | `bypassPermissions` |

210 

211**As a default**: to pin the permission mode conversations start in, set `claudeCode.initialPermissionMode` in your VS Code user settings to `default`, `manual`, `acceptEdits`, `plan`, or `bypassPermissions`. The setting doesn't accept `auto`; to start in Auto, leave it unset and pick **Auto** from the mode indicator once, as item 2 below describes. The extension starts each new conversation in the first of these that applies:

212 

2131. `claudeCode.initialPermissionMode`

2142. The mode you last picked from the mode indicator, if it was Manual, Edit automatically, or Auto. Picking Plan or Bypass permissions applies to that conversation only

2153. `permissions.defaultMode` from [managed settings](https://code.claude.com/docs/en/managed-settings.md) or `~/.claude/settings.json`

2164. The [built-in default](#which-mode-a-session-starts-in) for your plan, provider, and organization settings

217 

218The extension never reads a project's `.claude/settings.json` or `.claude/settings.local.json` for the starting permission mode. When `claudeCode.claudeProcessWrapper` is set, items 3 and 4 don't apply: those conversations start in Manual unless item 1 or item 2 sets a permission mode.

219 

220Before v2.1.283, item 3 applied only on Pro, Max, and Team plans in sessions that [fetch feature flags](https://code.claude.com/docs/en/env-vars.md#features-that-need-feature-flag-fetching).

221 

222Auto appears in the mode indicator when [auto mode is available](#eliminate-prompts-with-auto-mode).

223 

224Bypass permissions requires the **Allow dangerously skip permissions** toggle in the extension settings. Without it, the permission mode doesn't appear in the indicator, and a `bypassPermissions` value from item 1 or item 3 starts the conversation in Manual instead. Auto from any item likewise starts the conversation in Manual when auto mode isn't available.

225 

226See the [VS Code guide](https://code.claude.com/docs/en/vs-code.md) for extension-specific details.

227 

228**JetBrains**

229 

230The JetBrains plugin runs Claude Code in the IDE terminal, so switching permission modes works the same as in the CLI: press `Shift+Tab` to cycle, or pass `--permission-mode` when launching.

231 

232**Desktop**

233 

234**During a session**: in the Code tab, use the mode selector in the row under the prompt box. Not every mode appears in the selector:

235 

236* **Auto**: appears when [auto mode is available](#eliminate-prompts-with-auto-mode)

237* **Bypass permissions**: requires the **Allow bypass permissions mode** toggle in Desktop settings on Pro and Max plans; on Team and Enterprise plans, organization policy controls it instead

238 

239Cowork doesn't use these modes. It has its own permission modes, enabled separately, and shows no mode selector at all until a mode beyond its default is enabled for your account. See the [Cowork docs](https://claude.com/docs/cowork/overview).

240 

241For desktop-specific details, see [Choose a permission mode](https://code.claude.com/docs/en/desktop.md#choose-a-permission-mode) in the Desktop guide.

242 

243**As a default**: set `defaultMode` in [settings](https://code.claude.com/docs/en/settings.md#where-settings-live). The desktop app reads the same settings files as the CLI and applies the permission mode to new local sessions.

244 

245A mode you pick in the mode selector is remembered per folder and takes precedence over `defaultMode` for that folder. Plan is the exception: picking it applies to the current session only.

246 

247For where `defaultMode` goes in a settings file, see the example under [Start in a different permission mode](#start-in-a-different-mode).

248 

249**Web and mobile**

250 200 

251On [claude.ai/code](https://claude.ai/code), use the mode dropdown in the row under the prompt box. In the mobile app, tap the **+** button in the prompt box, then **Permission**. Cloud sessions and Remote Control sessions offer different permission modes:201> [tab] VS Code

202>

203> **During a session**: click the mode indicator at the bottom of the prompt box. It uses these labels for the modes on this page:

204>

205> | UI label | Mode |

206> | :- | :- |

207> | Manual | `default` |

208> | Edit automatically | `acceptEdits` |

209> | Plan | `plan` |

210> | Auto | `auto` |

211> | Bypass permissions | `bypassPermissions` |

212>

213> **As a default**: to pin the permission mode conversations start in, set `claudeCode.initialPermissionMode` in your VS Code user settings to `default`, `manual`, `acceptEdits`, `plan`, or `bypassPermissions`. The setting doesn't accept `auto`; to start in Auto, leave it unset and pick **Auto** from the mode indicator once, as item 2 below describes. The extension starts each new conversation in the first of these that applies:

214>

215> 1. `claudeCode.initialPermissionMode`

216> 2. The mode you last picked from the mode indicator, if it was Manual, Edit automatically, or Auto. Picking Plan or Bypass permissions applies to that conversation only

217> 3. `permissions.defaultMode` from [managed settings](https://code.claude.com/docs/en/managed-settings.md) or `~/.claude/settings.json`

218> 4. The [built-in default](#which-mode-a-session-starts-in) for your plan, provider, and organization settings

219>

220> The extension never reads a project's `.claude/settings.json` or `.claude/settings.local.json` for the starting permission mode. When `claudeCode.claudeProcessWrapper` is set, items 3 and 4 don't apply: those conversations start in Manual unless item 1 or item 2 sets a permission mode.

221>

222> Before v2.1.283, item 3 applied only on Pro, Max, Ultra, and Team plans in sessions that [fetch feature flags](https://code.claude.com/docs/en/env-vars.md#features-that-need-feature-flag-fetching).

223>

224> Auto appears in the mode indicator when [auto mode is available](#eliminate-prompts-with-auto-mode).

225>

226> Bypass permissions requires the **Allow dangerously skip permissions** toggle in the extension settings. Without it, the permission mode doesn't appear in the indicator, and a `bypassPermissions` value from item 1 or item 3 starts the conversation in Manual instead. Auto from any item likewise starts the conversation in Manual when auto mode isn't available.

227>

228> See the [VS Code guide](https://code.claude.com/docs/en/vs-code.md) for extension-specific details.

252 229 

253* **[Cloud sessions](https://code.claude.com/docs/en/claude-code-on-the-web.md)**: Accept edits, Plan, and Auto. Accept edits corresponds to `default` mode: cloud sessions pre-approve file edits regardless of mode, so the dropdown shows Accept edits instead of Manual. Cloud sessions still honor `defaultMode: "acceptEdits"` from settings. Auto mode appears only when your organization allows it and the selected model supports it. Bypass permissions isn't available.230> [tab] JetBrains

254* **[Remote Control](https://code.claude.com/docs/en/remote-control.md) sessions** on your local machine: Manual, Accept edits, Plan, and Auto for a session you started yourself, and you can't select Bypass permissions from the app. To use Auto, the session has to meet the auto mode [availability requirements](#eliminate-prompts-with-auto-mode). For a project thread running on your computer, see [Run a thread on your own computer](https://code.claude.com/docs/en/claude-projects.md#run-a-thread-on-your-own-computer).231>

255 * Except for Bypass permissions, the dropdown shows the permission mode the local session is in, including one set from the terminal. It updates when the permission mode changes in the app or in the terminal.232> The JetBrains plugin runs Claude Code in the IDE terminal, so switching permission modes works the same as in the CLI: press `Shift+Tab` to cycle, or pass `--permission-mode` when launching.

256 * Sessions hosted by the [desktop app](https://code.claude.com/docs/en/desktop.md) or the [VS Code extension](https://code.claude.com/docs/en/vs-code.md) report permission mode changes to claude.ai as they happen, the same as sessions hosted in a terminal.

257 233 

258For Remote Control, the local machine running the session must be signed in with your claude.ai account; API keys aren't supported. You can also set the starting permission mode when launching that local session:234> [tab] Desktop

235>

236> **During a session**: in the Code tab, use the mode selector in the row under the prompt box. Not every mode appears in the selector:

237>

238> * **Auto**: appears when [auto mode is available](#eliminate-prompts-with-auto-mode)

239> * **Bypass permissions**: requires the **Allow bypass permissions mode** toggle in Desktop settings on Pro, Max, and Ultra plans; on Team and Enterprise plans, organization policy controls it instead

240>

241> Cowork doesn't use these modes. It has its own permission modes, enabled separately, and shows no mode selector at all until a mode beyond its default is enabled for your account. See the [Cowork docs](https://claude.com/docs/cowork/overview).

242>

243> For desktop-specific details, see [Choose a permission mode](https://code.claude.com/docs/en/desktop.md#choose-a-permission-mode) in the Desktop guide.

244>

245> **As a default**: set `defaultMode` in [settings](https://code.claude.com/docs/en/settings.md#where-settings-live). The desktop app reads the same settings files as the CLI and applies the permission mode to new local sessions.

246>

247> A mode you pick in the mode selector is remembered per folder and takes precedence over `defaultMode` for that folder. Plan is the exception: picking it applies to the current session only.

248>

249> For where `defaultMode` goes in a settings file, see the example under [Start in a different permission mode](#start-in-a-different-mode).

259 250 

260```bash theme={null}251> [tab] Web and mobile

261claude remote-control --permission-mode acceptEdits252>

262```253> On [claude.ai/code](https://claude.ai/code), use the mode dropdown in the row under the prompt box. In the mobile app, tap the **+** button in the prompt box, then **Permission**. Cloud sessions and Remote Control sessions offer different permission modes:

254>

255> * **[Cloud sessions](https://code.claude.com/docs/en/claude-code-on-the-web.md)**: Accept edits, Plan, and Auto. Accept edits corresponds to `default` mode: cloud sessions pre-approve file edits regardless of mode, so the dropdown shows Accept edits instead of Manual. Cloud sessions still honor `defaultMode: "acceptEdits"` from settings. Auto mode appears only when your organization allows it and the selected model supports it. Bypass permissions isn't available.

256> * **[Remote Control](https://code.claude.com/docs/en/remote-control.md) sessions** on your local machine: Manual, Accept edits, Plan, and Auto for a session you started yourself, and you can't select Bypass permissions from the app. To use Auto, the session has to meet the auto mode [availability requirements](#eliminate-prompts-with-auto-mode). For a project thread running on your computer, see [Run a thread on your own computer](https://code.claude.com/docs/en/claude-projects.md#run-a-thread-on-your-own-computer).

257> * Except for Bypass permissions, the dropdown shows the permission mode the local session is in, including one set from the terminal. It updates when the permission mode changes in the app or in the terminal.

258> * Sessions hosted by the [desktop app](https://code.claude.com/docs/en/desktop.md) or the [VS Code extension](https://code.claude.com/docs/en/vs-code.md) report permission mode changes to claude.ai as they happen, the same as sessions hosted in a terminal.

259>

260> For Remote Control, the local machine running the session must be signed in with your claude.ai account; API keys aren't supported. You can also set the starting permission mode when launching that local session:

261>

262> ```bash theme={null}

263> claude remote-control --permission-mode acceptEdits

264> ```

263 265 

264## Auto-approve file edits with acceptEdits mode266## Auto-approve file edits with acceptEdits mode

265 267 


327 329 

328Auto mode lets Claude execute without routine permission prompts. A separate classifier model reviews actions before they run, blocking anything that escalates beyond your request, targets unrecognized infrastructure, or appears driven by hostile content Claude read. Explicit [ask rules](https://code.claude.com/docs/en/permissions.md#manage-permissions) still force a prompt.330Auto mode lets Claude execute without routine permission prompts. A separate classifier model reviews actions before they run, blocking anything that escalates beyond your request, targets unrecognized infrastructure, or appears driven by hostile content Claude read. Explicit [ask rules](https://code.claude.com/docs/en/permissions.md#manage-permissions) still force a prompt.

329 331 

330With Claude Code v2.1.283 or later, auto mode is the [built-in starting permission mode](#which-mode-a-session-starts-in) for interactive terminal and VS Code sessions on every plan and provider. On earlier versions, it's the built-in starting permission mode only on Pro, Max, and Team plans.332With Claude Code v2.1.283 or later, auto mode is the [built-in starting permission mode](#which-mode-a-session-starts-in) for interactive terminal and VS Code sessions on every plan and provider. On earlier versions, it's the built-in starting permission mode only on Pro, Max, Ultra, and Team plans.

331 333 

332The classifier also reviews each message Claude sends to another agent with [`SendMessage`](https://code.claude.com/docs/en/tools-reference), whether plain text or a structured [agent team](https://code.claude.com/docs/en/agent-teams.md) message, before Claude Code delivers it, both in auto mode and in [plan mode while the classifier reviews commands](#analyze-before-you-edit-with-plan-mode); the send review requires Claude Code v2.1.222 or later.334The classifier also reviews each message Claude sends to another agent with [`SendMessage`](https://code.claude.com/docs/en/tools-reference), whether plain text or a structured [agent team](https://code.claude.com/docs/en/agent-teams.md) message, before Claude Code delivers it, both in auto mode and in [plan mode while the classifier reviews commands](#analyze-before-you-edit-with-plan-mode); the send review requires Claude Code v2.1.222 or later.

333 335 


367 369 

368In auto mode, Claude Code can ask the server to check the actions that [the decision order](#how-the-classifier-evaluates-actions) sends for review, as part of the session's model requests, in place of sending its own classifier requests. These sessions ask:370In auto mode, Claude Code can ask the server to check the actions that [the decision order](#how-the-classifier-evaluates-actions) sends for review, as part of the session's model requests, in place of sending its own classifier requests. These sessions ask:

369 371 

370* **A direct connection to the Anthropic API**: in interactive terminal sessions and in `-p`, Agent SDK, [VS Code extension](https://code.claude.com/docs/en/vs-code.md), and [desktop app](https://code.claude.com/docs/en/desktop.md) sessions, whatever your plan or account type, as Anthropic rolls it out. In interactive terminal sessions, this requires Claude Code v2.1.271 or later on Pro, Max, and Team plans, and v2.1.278 or later on Enterprise plans and Claude API accounts. In `-p`, Agent SDK, VS Code extension, and desktop app sessions, this requires Claude Code v2.1.281 or later. From v2.1.282, a session that [doesn't fetch feature flags](https://code.claude.com/docs/en/env-vars.md#features-that-need-feature-flag-fetching), for example because you turned telemetry off, asks the server by default in any kind of session.372* **A direct connection to the Anthropic API**: in interactive terminal sessions and in `-p`, Agent SDK, [VS Code extension](https://code.claude.com/docs/en/vs-code.md), and [desktop app](https://code.claude.com/docs/en/desktop.md) sessions, whatever your plan or account type, as Anthropic rolls it out. Check your session type against these minimum Claude Code versions:

373 * In interactive terminal sessions, asking the server requires Claude Code v2.1.271 or later on Pro, Max, Ultra, and Team plans. On Enterprise plans and Claude API accounts, those sessions require v2.1.278 or later.

374 * In `-p`, Agent SDK, VS Code extension, and desktop app sessions, asking the server requires Claude Code v2.1.281 or later

375 * From v2.1.282, a session that [doesn't fetch feature flags](https://code.claude.com/docs/en/env-vars.md#features-that-need-feature-flag-fetching), for example because you turned telemetry off, asks the server by default in any kind of session

371* **A cloud provider, or an LLM gateway or proxy**: on [Claude Platform on AWS](https://code.claude.com/docs/en/claude-platform-on-aws.md), Amazon Bedrock, Google Cloud's Agent Platform, and Microsoft Foundry, and whenever you point `ANTHROPIC_BASE_URL` at an [LLM gateway or proxy](https://code.claude.com/docs/en/llm-gateway), whatever your plan. Asking by default requires Claude Code v2.1.278 or later.376* **A cloud provider, or an LLM gateway or proxy**: on [Claude Platform on AWS](https://code.claude.com/docs/en/claude-platform-on-aws.md), Amazon Bedrock, Google Cloud's Agent Platform, and Microsoft Foundry, and whenever you point `ANTHROPIC_BASE_URL` at an [LLM gateway or proxy](https://code.claude.com/docs/en/llm-gateway), whatever your plan. Asking by default requires Claude Code v2.1.278 or later.

372* **A signed-in [Claude apps gateway](https://code.claude.com/docs/en/claude-apps-gateway) session**: requires Claude Code v2.1.280 or later377* **A signed-in [Claude apps gateway](https://code.claude.com/docs/en/claude-apps-gateway) session**: requires Claude Code v2.1.280 or later

373* **A [cloud session](https://code.claude.com/docs/en/claude-code-on-the-web.md) in an Anthropic-hosted environment**: whatever your plan, when you start it from the web, the mobile app, or the desktop app with **Cloud** selected. Sessions started by a [cloud scheduled task](https://code.claude.com/docs/en/routines.md) ask the server as Anthropic rolls it out.378* **A [cloud session](https://code.claude.com/docs/en/claude-code-on-the-web.md) in an Anthropic-hosted environment**: whatever your plan, when you start it from the web, the mobile app, or the desktop app with **Cloud** selected. Sessions started by a [cloud scheduled task](https://code.claude.com/docs/en/routines.md) ask the server as Anthropic rolls it out.


566 571 

567The following sections cover the order Claude Code evaluates an action in, how the classifier reviews subagent work, and what classifier calls add in cost and latency.572The following sections cover the order Claude Code evaluates an action in, how the classifier reviews subagent work, and what classifier calls add in cost and latency.

568 573 

569> **How the classifier evaluates actions**574> [accordion] How the classifier evaluates actions

570>575>

571> Each action goes through a fixed decision order. The first matching step wins:576> Each action goes through a fixed decision order. The first matching step wins:

572>577>


608>613>

609> A separate server-side probe scans incoming tool results and flags suspicious content before Claude reads it. For more on how these layers work together, see the [auto mode announcement](https://claude.com/blog/auto-mode) and the [engineering deep dive](https://www.anthropic.com/engineering/claude-code-auto-mode).614> A separate server-side probe scans incoming tool results and flags suspicious content before Claude reads it. For more on how these layers work together, see the [auto mode announcement](https://claude.com/blog/auto-mode) and the [engineering deep dive](https://www.anthropic.com/engineering/claude-code-auto-mode).

610 615 

611> **How auto mode handles subagents**616> [accordion] How auto mode handles subagents

612>617>

613> The classifier checks [subagent](https://code.claude.com/docs/en/sub-agents.md) work at three points:618> The classifier checks [subagent](https://code.claude.com/docs/en/sub-agents.md) work at three points:

614>619>


616> 2. While the subagent runs, each of its actions goes through the same [decision order](#how-the-classifier-evaluates-actions) as in the parent session, with the same block and allow rules. Any `permissionMode` in the subagent's frontmatter is ignored.621> 2. While the subagent runs, each of its actions goes through the same [decision order](#how-the-classifier-evaluates-actions) as in the parent session, with the same block and allow rules. Any `permissionMode` in the subagent's frontmatter is ignored.

617> 3. When the subagent finishes, the classifier reviews its work and its final report before the parent reads the report. When the classifier flags the subagent's work or report, or a separate API safety check refuses the review, the report is still delivered, prepended with a security warning. When the classifier is unavailable for the review, the report arrives with a note to verify the subagent's work before acting on it.622> 3. When the subagent finishes, the classifier reviews its work and its final report before the parent reads the report. When the classifier flags the subagent's work or report, or a separate API safety check refuses the review, the report is still delivered, prepended with a security warning. When the classifier is unavailable for the review, the report arrives with a note to verify the subagent's work before acting on it.

618 623 

619> **Cost and latency**624> [accordion] Cost and latency

620>625>

621> Claude Code's classifier requests can run on a model other than your `/model` selection. See [which model they run on](#default-classifier-model).626> Claude Code's classifier requests can run on a model other than your `/model` selection. See [which model they run on](#default-classifier-model).

622>627>


964 969 

965To run Bash `rm` and `rmdir` commands that target [critical paths](#critical-paths) with no prompt in `bypassPermissions` mode, start Claude Code with [`CLAUDE_CODE_EVEN_MORE_DANGEROUSLY_SKIP_PERMISSIONS=1`](https://code.claude.com/docs/en/env-vars#variables) in its environment. This requires Claude Code v2.1.311 or later. Claude Code reads the variable from the launch environment only and [ignores it in a settings file's `env` block](https://code.claude.com/docs/en/settings-reference#variables-claude-code-ignores-in-env). For example, set it in [your shell](https://code.claude.com/docs/en/env-vars.md#set-variables-in-your-shell) and start `claude` from there:970To run Bash `rm` and `rmdir` commands that target [critical paths](#critical-paths) with no prompt in `bypassPermissions` mode, start Claude Code with [`CLAUDE_CODE_EVEN_MORE_DANGEROUSLY_SKIP_PERMISSIONS=1`](https://code.claude.com/docs/en/env-vars#variables) in its environment. This requires Claude Code v2.1.311 or later. Claude Code reads the variable from the launch environment only and [ignores it in a settings file's `env` block](https://code.claude.com/docs/en/settings-reference#variables-claude-code-ignores-in-env). For example, set it in [your shell](https://code.claude.com/docs/en/env-vars.md#set-variables-in-your-shell) and start `claude` from there:

966 971 

967**macOS, Linux, WSL**972> [tab] macOS, Linux, WSL

968 973>

969```bash theme={null}974> ```bash theme={null}

970export CLAUDE_CODE_EVEN_MORE_DANGEROUSLY_SKIP_PERMISSIONS=1975> export CLAUDE_CODE_EVEN_MORE_DANGEROUSLY_SKIP_PERMISSIONS=1

971claude --permission-mode bypassPermissions976> claude --permission-mode bypassPermissions

972```977> ```

973 

974**Windows PowerShell**

975 

976```powershell theme={null}

977$env:CLAUDE_CODE_EVEN_MORE_DANGEROUSLY_SKIP_PERMISSIONS = "1"

978claude --permission-mode bypassPermissions

979```

980 978 

981**Windows CMD**979> [tab] Windows PowerShell

980>

981> ```powershell theme={null}

982> $env:CLAUDE_CODE_EVEN_MORE_DANGEROUSLY_SKIP_PERMISSIONS = "1"

983> claude --permission-mode bypassPermissions

984> ```

982 985 

983```batch theme={null}986> [tab] Windows CMD

984set CLAUDE_CODE_EVEN_MORE_DANGEROUSLY_SKIP_PERMISSIONS=1987>

985claude --permission-mode bypassPermissions988> ```batch theme={null}

986```989> set CLAUDE_CODE_EVEN_MORE_DANGEROUSLY_SKIP_PERMISSIONS=1

990> claude --permission-mode bypassPermissions

991> ```

987 992 

988> [!WARNING]993> [!WARNING]

989>994>

platforms.md +6 −6

Details

14 14 

15| Platform | Best for | What you get |15| Platform | Best for | What you get |

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

17| [CLI](https://code.claude.com/docs/en/quickstart.md) | Terminal workflows, scripting, remote servers | Full feature set, [Agent SDK](https://code.claude.com/docs/en/headless.md), [computer use](https://code.claude.com/docs/en/computer-use.md) on macOS (Pro and Max), third-party providers |17| [CLI](https://code.claude.com/docs/en/quickstart.md) | Terminal workflows, scripting, remote servers | Full feature set, [Agent SDK](https://code.claude.com/docs/en/headless.md), [computer use](https://code.claude.com/docs/en/computer-use.md) on macOS (Pro, Max, and Ultra), third-party providers |

18| [Desktop](https://code.claude.com/docs/en/desktop.md) | Visual review, parallel sessions, managed setup | Diff viewer, app preview, [computer use](https://code.claude.com/docs/en/desktop.md#let-claude-use-your-computer) and [Dispatch](https://code.claude.com/docs/en/desktop.md#sessions-from-dispatch) on Pro and Max |18| [Desktop](https://code.claude.com/docs/en/desktop.md) | Visual review, parallel sessions, managed setup | Diff viewer, app preview, [computer use](https://code.claude.com/docs/en/desktop.md#let-claude-use-your-computer) and [Dispatch](https://code.claude.com/docs/en/desktop.md#sessions-from-dispatch) on Pro, Max, and Ultra |

19| [VS Code](https://code.claude.com/docs/en/vs-code.md) | Working inside VS Code without switching to a terminal | Inline diffs, integrated terminal, file context |19| [VS Code](https://code.claude.com/docs/en/vs-code.md) | Working inside VS Code without switching to a terminal | Inline diffs, integrated terminal, file context |

20| [JetBrains](https://code.claude.com/docs/en/jetbrains.md) | Working inside IntelliJ, PyCharm, WebStorm, or other JetBrains IDEs | Diff viewer, selection sharing, terminal session |20| [JetBrains](https://code.claude.com/docs/en/jetbrains.md) | Working inside IntelliJ, PyCharm, WebStorm, or other JetBrains IDEs | Diff viewer, selection sharing, terminal session |

21| [Web](https://code.claude.com/docs/en/claude-code-on-the-web.md) | Long-running tasks that don't need much steering, or work that should continue when you're offline | Cloud, Anthropic-managed by default; continues after you disconnect |21| [Web](https://code.claude.com/docs/en/claude-code-on-the-web.md) | Long-running tasks that don't need much steering, or work that should continue when you're offline | Cloud, Anthropic-managed by default; continues after you disconnect |

22| [Mobile](https://code.claude.com/docs/en/mobile.md) | Starting and monitoring tasks while away from your computer | Cloud sessions from the Claude app for iOS and Android, [Remote Control](https://code.claude.com/docs/en/remote-control.md) for local sessions, [Dispatch](https://code.claude.com/docs/en/desktop.md#sessions-from-dispatch) to Desktop on Pro and Max |22| [Mobile](https://code.claude.com/docs/en/mobile.md) | Starting and monitoring tasks while away from your computer | Cloud sessions from the Claude app for iOS and Android, [Remote Control](https://code.claude.com/docs/en/remote-control.md) for local sessions, [Dispatch](https://code.claude.com/docs/en/desktop.md#sessions-from-dispatch) to Desktop on Pro, Max, and Ultra |

23 23 

24The CLI is the most complete surface for terminal-native work: scripting and the Agent SDK are CLI-only. Third-party providers also work in [VS Code](https://code.claude.com/docs/en/vs-code.md#use-third-party-providers) and in [JetBrains](https://code.claude.com/docs/en/feature-availability.md#features-available-on-every-provider), which runs the CLI in your IDE's terminal. Enterprise [Desktop](https://code.claude.com/docs/en/desktop.md) deployments support Google Cloud's Agent Platform, and Desktop supports [gateway providers](https://code.claude.com/docs/en/llm-gateway-connect.md#desktop-app); for Amazon Bedrock or Microsoft Foundry, use the CLI or an IDE extension, or [Claude Desktop on 3P](https://claude.com/docs/third-party/claude-desktop/overview), which runs the Code tab on those providers. Desktop and the IDE extensions trade some CLI-only features for visual review and tighter editor integration. The web runs in the cloud, so tasks keep going after you disconnect. Mobile is a thin client into those same cloud sessions or into a local session via Remote Control, and can send tasks to Desktop with Dispatch.24The CLI is the most complete surface for terminal-native work: scripting and the Agent SDK are CLI-only. Third-party providers also work in [VS Code](https://code.claude.com/docs/en/vs-code.md#use-third-party-providers) and in [JetBrains](https://code.claude.com/docs/en/feature-availability.md#features-available-on-every-provider), which runs the CLI in your IDE's terminal. Enterprise [Desktop](https://code.claude.com/docs/en/desktop.md) deployments support Google Cloud's Agent Platform, and Desktop supports [gateway providers](https://code.claude.com/docs/en/llm-gateway-connect.md#desktop-app); for Amazon Bedrock or Microsoft Foundry, use the CLI or an IDE extension, or [Claude Desktop on 3P](https://claude.com/docs/third-party/claude-desktop/overview), which runs the Code tab on those providers. Desktop and the IDE extensions trade some CLI-only features for visual review and tighter editor integration. The web runs in the cloud, so tasks keep going after you disconnect. Mobile is a thin client into those same cloud sessions or into a local session via Remote Control, and can send tasks to Desktop with Dispatch.

25 25 


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

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

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

38| [Slack](https://code.claude.com/docs/en/slack.md) | Responds to `@Claude` mentions in your channels, under your own account | Turning bug reports into pull requests from team chat on Pro and Max plans |38| [Slack](https://code.claude.com/docs/en/slack.md) | Responds to `@Claude` mentions in your channels, under your own account | Turning bug reports into pull requests from team chat on Pro, Max, and Ultra plans |

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

40 40 

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


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

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

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

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

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

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

55 55 


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

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

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

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

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

79 79 

80### Remote access80### Remote access

plugins/install.md +96 −96

Details

27 27 

28Pick the tab for where you run Claude Code.28Pick the tab for where you run Claude Code.

29 29 

30**Terminal**30> [tab] Terminal

31 31>

32Start Claude Code with `claude` in your project, then:32> Start Claude Code with `claude` in your project, then:

33 33>

34**1. Open the plugin's details with the install command**34> **1. Open the plugin's details with the install command**

35 35>

36Run `/plugin install` with the plugin's name and marketplace. In a session, this command doesn't install right away: it opens the `/plugin` panel on that plugin's details so you can review it and choose a scope first.36> Run `/plugin install` with the plugin's name and marketplace. In a session, this command doesn't install right away: it opens the `/plugin` panel on that plugin's details so you can review it and choose a scope first.

37 37>

38```text theme={null}38> ```text theme={null}

39/plugin install commit-commands@claude-plugins-official39> /plugin install commit-commands@claude-plugins-official

40```40> ```

41 41>

42To browse instead, run `/plugin` with no plugin name: the panel opens on the **Discover** tab, which lists the plugins from your marketplaces, and you can type to search, then press **Enter** on a plugin to open its details.42> To browse instead, run `/plugin` with no plugin name: the panel opens on the **Discover** tab, which lists the plugins from your marketplaces, and you can type to search, then press **Enter** on a plugin to open its details.

43 43>

44**2. Review what the plugin adds**44> **2. Review what the plugin adds**

45 45>

46The details pane shows the plugin's description. It can also show:46> The details pane shows the plugin's description. It can also show:

47 47>

48* **Will install**: the commands, agents, skills, hooks, and MCP and LSP servers the plugin adds.48> * **Will install**: the commands, agents, skills, hooks, and MCP and LSP servers the plugin adds.

49* **Last updated**: shown for a plugin in Anthropic's official marketplace.49> * **Last updated**: shown for a plugin in Anthropic's official marketplace.

50* **Context cost**: for a plugin in Anthropic's official marketplace, two token estimates. **Every turn** is what the plugin adds to each message you send, and **When invoked** is what its skills and agents add once Claude loads them. The estimates appear when you open the plugin by naming its marketplace, as the step 1 command does, or from the **Marketplaces** tab. The details pane you reach from the **Discover** list doesn't show them.50> * **Context cost**: for a plugin in Anthropic's official marketplace, two token estimates. **Every turn** is what the plugin adds to each message you send, and **When invoked** is what its skills and agents add once Claude loads them. The estimates appear when you open the plugin by naming its marketplace, as the step 1 command does, or from the **Marketplaces** tab. The details pane you reach from the **Discover** list doesn't show them.

51 51>

52Plugins from a local or custom marketplace can show `Components will be discovered at installation` instead.52> Plugins from a local or custom marketplace can show `Components will be discovered at installation` instead.

53 53>

54A plugin can run hooks and MCP servers, so read the pane before you install. See [Plugin security and trust](https://code.claude.com/docs/en/plugins/security.md).54> A plugin can run hooks and MCP servers, so read the pane before you install. See [Plugin security and trust](https://code.claude.com/docs/en/plugins/security.md).

55 55>

56**3. Choose a scope**56> **3. Choose a scope**

57 57>

58Select one of the three install options:58> Select one of the three install options:

59 59>

60* **Install for you (user scope)**: you get the plugin in every project on this machine60> * **Install for you (user scope)**: you get the plugin in every project on this machine

61* **Install for all collaborators on this repository (project scope)**: it's enabled for everyone who works in this repository61> * **Install for all collaborators on this repository (project scope)**: it's enabled for everyone who works in this repository

62* **Install for you, in this repo only (local scope)**: you get it in this repository only62> * **Install for you, in this repo only (local scope)**: you get it in this repository only

63 63>

64[Choose an install scope](#choose-an-install-scope) says which settings file each one writes to and which applies when the same plugin is set at more than one.64> [Choose an install scope](#choose-an-install-scope) says which settings file each one writes to and which applies when the same plugin is set at more than one.

65 65>

66After you select a scope, Claude Code installs the plugin along with any dependencies it declares, then prints an install summary.66> After you select a scope, Claude Code installs the plugin along with any dependencies it declares, then prints an install summary.

67 67>

68**4. Read the install summary**68> **4. Read the install summary**

69 69>

70The last sentence of the summary tells you whether the plugin is usable in this session yet:70> The last sentence of the summary tells you whether the plugin is usable in this session yet:

71 71>

72* **Active now**: `Plugin is now active.` No reload is needed.72> * **Active now**: `Plugin is now active.` No reload is needed.

73* **Active, but a server needs setup**: `Plugin is now active.` is followed by `Its bundled MCP server needs configuration before it can start`. The plugin's [bundled MCP server](https://code.claude.com/docs/en/plugins/components.md#include-a-packaged-mcpb-server) can't start until you set its options. Select the plugin on the **Installed** tab in `/plugin` and choose **Configure** to set the server's options.73> * **Active, but a server needs setup**: `Plugin is now active.` is followed by `Its bundled MCP server needs configuration before it can start`. The plugin's [bundled MCP server](https://code.claude.com/docs/en/plugins/components.md#include-a-packaged-mcpb-server) can't start until you set its options. Select the plugin on the **Installed** tab in `/plugin` and choose **Configure** to set the server's options.

74* **Reload needed**: `Run /reload-plugins to apply.` The panel closes and Claude Code runs that reload for you. If the reload would [invalidate the prompt cache](https://code.claude.com/docs/en/prompt-caching.md#enabling-or-disabling-a-plugin), it warns and leaves the plugin pending instead. Run `/reload-plugins --force` to activate it anyway, which costs one uncached request.74> * **Reload needed**: `Run /reload-plugins to apply.` The panel closes and Claude Code runs that reload for you. If the reload would [invalidate the prompt cache](https://code.claude.com/docs/en/prompt-caching.md#enabling-or-disabling-a-plugin), it warns and leaves the plugin pending instead. Run `/reload-plugins --force` to activate it anyway, which costs one uncached request.

75* **Load failed**: `The plugin couldn't be loaded`. Open the **Errors** tab in `/plugin` for the reason, then see [After install: plugin not working](https://code.claude.com/docs/en/plugins/troubleshooting.md#plugin-installed-but-not-working).75> * **Load failed**: `The plugin couldn't be loaded`. Open the **Errors** tab in `/plugin` for the reason, then see [After install: plugin not working](https://code.claude.com/docs/en/plugins/troubleshooting.md#plugin-installed-but-not-working).

76 76>

77**5. Confirm the plugin works**77> **5. Confirm the plugin works**

78 78>

79Type `/` and look for the plugin's skills under its name, in the form `/<plugin>:<skill>`. For `commit-commands`, `/commit-commands:commit` appears. Two other places list the plugin too:79> Type `/` and look for the plugin's skills under its name, in the form `/<plugin>:<skill>`. For `commit-commands`, `/commit-commands:commit` appears. Two other places list the plugin too:

80 80>

81* Open the **Installed** tab in `/plugin`, which lists the plugin with its scope.81> * Open the **Installed** tab in `/plugin`, which lists the plugin with its scope.

82* In your shell, run `claude plugin list`, which prints the same list with `Version`, `Scope`, and `Status` lines.82> * In your shell, run `claude plugin list`, which prints the same list with `Version`, `Scope`, and `Status` lines.

83 83>

84If `/commit-commands:commit` doesn't appear, see [After install: plugin not working](https://code.claude.com/docs/en/plugins/troubleshooting.md#plugin-installed-but-not-working).84> If `/commit-commands:commit` doesn't appear, see [After install: plugin not working](https://code.claude.com/docs/en/plugins/troubleshooting.md#plugin-installed-but-not-working).

85 85>

86Installing from any other marketplace requires one extra step first: [add the marketplace](#add-a-marketplace). Claude Code adds Anthropic's official marketplace for you the first time you start an interactive terminal session, which is why the example skips that step. If you found a plugin on [claude.com/marketplace](https://claude.com/marketplace), its **Claude Code** button copies the install command in its [shell form](#install-from-your-shell), `claude plugin install <name>@claude-plugins-official`.86> Installing from any other marketplace requires one extra step first: [add the marketplace](#add-a-marketplace). Claude Code adds Anthropic's official marketplace for you the first time you start an interactive terminal session, which is why the example skips that step. If you found a plugin on [claude.com/marketplace](https://claude.com/marketplace), its **Claude Code** button copies the install command in its [shell form](#install-from-your-shell), `claude plugin install <name>@claude-plugins-official`.

87 

88**Desktop app**

89 

90In a local or SSH session in the desktop app's **Code** tab:

91 

92**1. Open the plugin browser**

93 

94Click the **+** button next to the prompt box and select **Add plugins**. If the **+** menu shows **Plugins** instead of **Add plugins**, select **Plugins**, then **Browse plugins**. The plugin browser opens with the plugins from your marketplaces.

95 

96**2. Select the plugin**

97 

98Find `commit-commands` and select it.

99 

100**3. Choose a scope**

101 

102Choose a [scope](#choose-an-install-scope): your user account, this project, or local-only.

103 

104To enable, disable, or uninstall a plugin later, see [Install plugins in the desktop app](https://code.claude.com/docs/en/desktop.md#install-plugins).

105 

106**VS Code**

107 

108In the Claude Code panel in VS Code:

109 

110**1. Open Manage plugins**

111 

112Type `/plugins` in the prompt box to open **Manage plugins**.

113 

114**2. Install the plugin**

115 

116On the **Plugins** tab, search for `commit-commands` and click **Install**. If the tab lists no plugins, add `anthropics/claude-plugins-official` on the **Marketplaces** tab first.

117 

118**3. Choose a scope**

119 

120Choose a [scope](#choose-an-install-scope): **Install for you**, **Install for this project**, or **Install locally**.

121 

122Your changes apply to open sessions without a restart. See [Manage plugins in VS Code](https://code.claude.com/docs/en/vs-code.md#manage-plugins).

123 87 

124**Cloud session**88> [tab] Desktop app

89>

90> In a local or SSH session in the desktop app's **Code** tab:

91>

92> **1. Open the plugin browser**

93>

94> Click the **+** button next to the prompt box and select **Add plugins**. If the **+** menu shows **Plugins** instead of **Add plugins**, select **Plugins**, then **Browse plugins**. The plugin browser opens with the plugins from your marketplaces.

95>

96> **2. Select the plugin**

97>

98> Find `commit-commands` and select it.

99>

100> **3. Choose a scope**

101>

102> Choose a [scope](#choose-an-install-scope): your user account, this project, or local-only.

103>

104> To enable, disable, or uninstall a plugin later, see [Install plugins in the desktop app](https://code.claude.com/docs/en/desktop.md#install-plugins).

125 105 

126A [cloud session](https://code.claude.com/docs/en/cloud-environments.md), including [the browser at claude.ai/code](https://code.claude.com/docs/en/claude-code-on-the-web.md), has no plugin browser and doesn't load the plugins you installed on your own machine or the ones your repository's `.claude/settings.json` turns on. For plugins your organization distributes through managed settings, see [Manage plugins for your organization](https://code.claude.com/docs/en/plugins/org.md).106> [tab] VS Code

107>

108> In the Claude Code panel in VS Code:

109>

110> **1. Open Manage plugins**

111>

112> Type `/plugins` in the prompt box to open **Manage plugins**.

113>

114> **2. Install the plugin**

115>

116> On the **Plugins** tab, search for `commit-commands` and click **Install**. If the tab lists no plugins, add `anthropics/claude-plugins-official` on the **Marketplaces** tab first.

117>

118> **3. Choose a scope**

119>

120> Choose a [scope](#choose-an-install-scope): **Install for you**, **Install for this project**, or **Install locally**.

121>

122> Your changes apply to open sessions without a restart. See [Manage plugins in VS Code](https://code.claude.com/docs/en/vs-code.md#manage-plugins).

127 123 

128See [which parts of your setup are also available in a cloud session](https://code.claude.com/docs/en/cloud-environments.md#what-carries-over-from-your-setup) for the rest of your setup.124> [tab] Cloud session

125>

126> A [cloud session](https://code.claude.com/docs/en/cloud-environments.md), including [the browser at claude.ai/code](https://code.claude.com/docs/en/claude-code-on-the-web.md), has no plugin browser and doesn't load the plugins you installed on your own machine or the ones your repository's `.claude/settings.json` turns on. For plugins your organization distributes through managed settings, see [Manage plugins for your organization](https://code.claude.com/docs/en/plugins/org.md).

127>

128> See [which parts of your setup are also available in a cloud session](https://code.claude.com/docs/en/cloud-environments.md#what-carries-over-from-your-setup) for the rest of your setup.

129 129 

130### Choose an install scope130### Choose an install scope

131 131 

Details

116 116 

117### Usage share in `/usage`117### Usage share in `/usage`

118 118 

119On a Pro, Max, Team, or Enterprise plan, the `/usage` breakdown attributes recent usage to skills, subagents, plugins, and MCP servers as a share of the total. See [Using the `/usage` command](https://code.claude.com/docs/en/costs#using-the-/usage-command).119On a Pro, Max, Ultra, Team, or Enterprise plan, the `/usage` breakdown attributes recent usage to skills, subagents, plugins, and MCP servers as a share of the total. See [Using the `/usage` command](https://code.claude.com/docs/en/costs#using-the-/usage-command).

120 120 

121## Measure across a fleet121## Measure across a fleet

122 122 

Details

92 92 

93Create the two directories that hold the files:93Create the two directories that hold the files:

94 94 

95**Bash or Zsh**95> [tab] Bash or Zsh

96 96>

97```bash theme={null}97> ```bash theme={null}

98mkdir -p first-mod/.claude-plugin first-mod/hooks98> mkdir -p first-mod/.claude-plugin first-mod/hooks

99```99> ```

100 

101**PowerShell**

102 100 

103```powershell theme={null}101> [tab] PowerShell

104New-Item -ItemType Directory -Force first-mod\.claude-plugin, first-mod\hooks102>

105```103> ```powershell theme={null}

104> New-Item -ItemType Directory -Force first-mod\.claude-plugin, first-mod\hooks

105> ```

106 106 

107**2. Write the manifest**107**2. Write the manifest**

108 108 

Details

181 181 

182The pane and the band are empty until a mod fills them. Select a tab to see what each one is and how to draw in it:182The pane and the band are empty until a mod fills them. Select a tab to see what each one is and how to draw in it:

183 183 

184**Pane**184> [tab] Pane

185 185>

186A pane is a sidebar beside the transcript in a wide fullscreen terminal, or a framed region above the prompt otherwise. With several panes open, each gets a tab that shows its title.186> A pane is a sidebar beside the transcript in a wide fullscreen terminal, or a framed region above the prompt otherwise. With several panes open, each gets a tab that shows its title.

187 187>

188A pane appears when your mod calls `$.ui.open` with an `id` you choose, as in `$.ui.open({ id: 'hello-tabs' })`. [Open a pane at the right time](#open-a-pane-at-the-right-time) covers the other fields and when a pane waits for a wider terminal.188> A pane appears when your mod calls `$.ui.open` with an `id` you choose, as in `$.ui.open({ id: 'hello-tabs' })`. [Open a pane at the right time](#open-a-pane-at-the-right-time) covers the other fields and when a pane waits for a wider terminal.

189 189>

190To draw in your pane, filter on `{ component: 'Pane' }` and check that `e.requestId` is your `id`.190> To draw in your pane, filter on `{ component: 'Pane' }` and check that `e.requestId` is your `id`.

191 

192**Band above the prompt**

193 

194The band is a strip directly above the prompt input. It's always there, and every mod shares it.

195 

196Your hook returns a tree to show something in the band, or `next(e)` to show nothing. A tree replaces what the mods [after yours](https://code.claude.com/docs/en/plugins/mods/events.md#the-order-mods-run-in) draw there. To keep theirs, put the result of `await next(e)` among the children of a [`Box`](#build-a-tree-from-elements) in your tree.

197 191 

198To draw in the band, filter on `{ component: 'AbovePrompt' }`.192> [tab] Band above the prompt

193>

194> The band is a strip directly above the prompt input. It's always there, and every mod shares it.

195>

196> Your hook returns a tree to show something in the band, or `next(e)` to show nothing. A tree replaces what the mods [after yours](https://code.claude.com/docs/en/plugins/mods/events.md#the-order-mods-run-in) draw there. To keep theirs, put the result of `await next(e)` among the children of a [`Box`](#build-a-tree-from-elements) in your tree.

197>

198> To draw in the band, filter on `{ component: 'AbovePrompt' }`.

199 199 

200### Change what Claude Code already draws200### Change what Claude Code already draws

201 201 


214 214 

215At a site Claude Code already draws, your hook can change a detail, replace the drawing, or leave it alone. Select a tab to see each one applied to the spinner. The examples read a `calls` variable that another hook counts, as in the [tutorial mod](https://code.claude.com/docs/en/plugins/mods/create.md#write-a-mod-yourself).215At a site Claude Code already draws, your hook can change a detail, replace the drawing, or leave it alone. Select a tab to see each one applied to the spinner. The examples read a `calls` variable that another hook counts, as in the [tutorial mod](https://code.claude.com/docs/en/plugins/mods/create.md#write-a-mod-yourself).

216 216 

217**Change a detail**217> [tab] Change a detail

218 218>

219To keep Claude Code's drawing and change one part of it, pass `next` a copy of the event with changed `props`. This hook changes the text after the spinner's word:219> To keep Claude Code's drawing and change one part of it, pass `next` a copy of the event with changed `props`. This hook changes the text after the spinner's word:

220 220>

221```javascript theme={null}221> ```javascript theme={null}

222on('ui.render', { component: 'Spinner' }, async ($, e, next) => {222> on('ui.render', { component: 'Spinner' }, async ($, e, next) => {

223 // Keep Claude Code's spinner, and change the text after its word223> // Keep Claude Code's spinner, and change the text after its word

224 return next({ ...e, props: { ...e.props, suffix: ' · tool calls: ' + calls + '…' } })224> return next({ ...e, props: { ...e.props, suffix: ' · tool calls: ' + calls + '…' } })

225})225> })

226```226> ```

227 227>

228The spinner keeps its animation and its word, and your text follows the word:228> The spinner keeps its animation and its word, and your text follows the word:

229 229>

230```text theme={null}230> ```text theme={null}

231Thinking · tool calls: 2…231> Thinking · tool calls: 2…

232```232> ```

233 

234**Replace the drawing**

235 

236To draw something of your own in the site's place, return a tree and don't call `next`. This hook draws one line of text where the spinner would be:

237 

238```javascript theme={null}

239on('ui.render', { component: 'Spinner' }, async ($, e) => {

240 const { Text } = $.ui.resolve(e)

241 // No call to next, so this line is drawn in the spinner's place

242 return Text({ children: ['Claude has made ' + calls + ' tool calls'] })

243})

244```

245 

246While Claude works, your line shows and Claude Code's spinner doesn't:

247 

248```text theme={null}

249Claude has made 2 tool calls

250```

251 

252**Leave it alone**

253 

254To leave the site as Claude Code draws it, return `next(e)`. A hook often does that for some events and not others. This hook leaves the spinner alone until there's a call to count:

255 

256```javascript theme={null}

257on('ui.render', { component: 'Spinner' }, async ($, e, next) => {

258 // Nothing to show yet, so pass the event on unchanged

259 if (calls === 0) return next(e)

260 return next({ ...e, props: { ...e.props, suffix: ' · tool calls: ' + calls + '…' } })

261})

262```

263 233 

264Before the first tool call, the spinner looks the way it does without the mod:234> [tab] Replace the drawing

235>

236> To draw something of your own in the site's place, return a tree and don't call `next`. This hook draws one line of text where the spinner would be:

237>

238> ```javascript theme={null}

239> on('ui.render', { component: 'Spinner' }, async ($, e) => {

240> const { Text } = $.ui.resolve(e)

241> // No call to next, so this line is drawn in the spinner's place

242> return Text({ children: ['Claude has made ' + calls + ' tool calls'] })

243> })

244> ```

245>

246> While Claude works, your line shows and Claude Code's spinner doesn't:

247>

248> ```text theme={null}

249> Claude has made 2 tool calls

250> ```

265 251 

266```text theme={null}252> [tab] Leave it alone

267Thinking…253>

268```254> To leave the site as Claude Code draws it, return `next(e)`. A hook often does that for some events and not others. This hook leaves the spinner alone until there's a call to count:

255>

256> ```javascript theme={null}

257> on('ui.render', { component: 'Spinner' }, async ($, e, next) => {

258> // Nothing to show yet, so pass the event on unchanged

259> if (calls === 0) return next(e)

260> return next({ ...e, props: { ...e.props, suffix: ' · tool calls: ' + calls + '…' } })

261> })

262> ```

263>

264> Before the first tool call, the spinner looks the way it does without the mod:

265>

266> ```text theme={null}

267> Thinking…

268> ```

269 269 

270At these sites, `next(e)` returns a reference to Claude Code's drawing, `{ type: 'engine', ref }`, unless a mod that runs after yours returned a tree of its own. To change what's in that drawing, pass `next` a copy of the event with different props, as the **Change a detail** tab does. You can return the reference as it is, or place it in a `Box` beside elements of your own:270At these sites, `next(e)` returns a reference to Claude Code's drawing, `{ type: 'engine', ref }`, unless a mod that runs after yours returned a tree of its own. To change what's in that drawing, pass `next` a copy of the event with different props, as the **Change a detail** tab does. You can return the reference as it is, or place it in a `Box` beside elements of your own:

271 271 


357 357 

358Select a tab to see each of the most common elements and how the terminal draws it:358Select a tab to see each of the most common elements and how the terminal draws it:

359 359 

360**Text**360> [tab] Text

361 361>

362`Text` draws a string, with optional styling such as `bold` and `color`:362> `Text` draws a string, with optional styling such as `bold` and `color`:

363 363>

364```javascript theme={null}364> ```javascript theme={null}

365Text({ children: ['This is the first tab.'] })365> Text({ children: ['This is the first tab.'] })

366```366> ```

367 367>

368```text theme={null}368> ```text theme={null}

369This is the first tab.369> This is the first tab.

370```370> ```

371 

372**Box**

373 

374`Box` arranges what's inside it, in a row or a column. This one puts a button and a line of text side by side, two columns apart:

375 

376```javascript theme={null}

377Box({

378 flexDirection: 'row',

379 columnGap: 2,

380 children: [

381 Button({ key: 'more', label: 'Add one', onPress: addOne }),

382 Text({ children: ['Count: 0'] }),

383 ],

384})

385```

386 

387```text theme={null}

388[ Add one ] Count: 0

389```

390 

391**Button**

392 

393`Button` is a control the user can press. It runs your `onPress` callback. With `plain: true` it has no brackets and shows its hotkey:

394 

395```javascript theme={null}

396Button({ key: 'more', label: 'Add one', onPress: addOne })

397Button({ key: 'tab-one', label: 'One', hotkey: '1', plain: true, onPress: showTabOne })

398```

399 

400```text theme={null}

401[ Add one ]

4021: One

403```

404 

405**Input**

406 

407`Input` is a text field. It runs your `onSubmit` callback with the text when the user presses Enter:

408 371 

409```javascript theme={null}372> [tab] Box

410Input({373>

411 key: 'new-note',374> `Box` arranges what's inside it, in a row or a column. This one puts a button and a line of text side by side, two columns apart:

412 label: 'Note',375>

413 placeholder: 'Type a note and press Enter',376> ```javascript theme={null}

414 value: '',377> Box({

415 submitLabel: 'add',378> flexDirection: 'row',

416 onSubmit: addNote,379> columnGap: 2,

417})380> children: [

418```381> Button({ key: 'more', label: 'Add one', onPress: addOne }),

382> Text({ children: ['Count: 0'] }),

383> ],

384> })

385> ```

386>

387> ```text theme={null}

388> [ Add one ] Count: 0

389> ```

419 390 

420```text theme={null}391> [tab] Button

421Note: Type a note and press Enter392>

422```393> `Button` is a control the user can press. It runs your `onPress` callback. With `plain: true` it has no brackets and shows its hotkey:

394>

395> ```javascript theme={null}

396> Button({ key: 'more', label: 'Add one', onPress: addOne })

397> Button({ key: 'tab-one', label: 'One', hotkey: '1', plain: true, onPress: showTabOne })

398> ```

399>

400> ```text theme={null}

401> [ Add one ]

402> 1: One

403> ```

423 404 

424Set `rows` to 2 or more for [a field that holds several lines](https://code.claude.com/docs/en/plugins/mods/gallery.md#input).405> [tab] Input

406>

407> `Input` is a text field. It runs your `onSubmit` callback with the text when the user presses Enter:

408>

409> ```javascript theme={null}

410> Input({

411> key: 'new-note',

412> label: 'Note',

413> placeholder: 'Type a note and press Enter',

414> value: '',

415> submitLabel: 'add',

416> onSubmit: addNote,

417> })

418> ```

419>

420> ```text theme={null}

421> Note: Type a note and press Enter

422> ```

423>

424> Set `rows` to 2 or more for [a field that holds several lines](https://code.claude.com/docs/en/plugins/mods/gallery.md#input).

425 425 

426The [interface gallery](https://code.claude.com/docs/en/plugins/mods/gallery.md) has samples and screenshots of most elements. This table lists every element:426The [interface gallery](https://code.claude.com/docs/en/plugins/mods/gallery.md) has samples and screenshots of most elements. This table lists every element:

427 427 

Details

132 132 

133**1. Confirm you can submit**133**1. Confirm you can submit**

134 134 

135Submitting requires a paid claude.ai plan. On Pro and Max you submit from your own account. On Team and Enterprise, an Owner can submit, and on Enterprise an Owner can also grant the **Directory** permission to other members through a custom role under **Organization settings > Roles**. See [Confirm you can submit to the directory](https://claude.com/docs/directory/publish#confirm-you-can-submit-to-the-directory).135Submitting requires a paid claude.ai plan. On Pro, Max, and Ultra you submit from your own account. On Team and Enterprise, an Owner can submit, and on Enterprise an Owner can also grant the **Directory** permission to other members through a custom role under **Organization settings > Roles**. See [Confirm you can submit to the directory](https://claude.com/docs/directory/publish#confirm-you-can-submit-to-the-directory).

136 136 

137**2. Validate the plugin locally**137**2. Validate the plugin locally**

138 138 

Details

302 302 

303Cloning a marketplace, and re-cloning one to update it, gets 120 seconds by default. For a large repository or a slow connection, raise the limit. The value is in milliseconds:303Cloning a marketplace, and re-cloning one to update it, gets 120 seconds by default. For a large repository or a slow connection, raise the limit. The value is in milliseconds:

304 304 

305**Bash or Zsh**305> [tab] Bash or Zsh

306 306>

307```bash theme={null}307> ```bash theme={null}

308export CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MS=300000308> export CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MS=300000

309```309> ```

310 

311**PowerShell**

312 310 

313```powershell theme={null}311> [tab] PowerShell

314$env:CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MS = "300000"312>

315```313> ```powershell theme={null}

314> $env:CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MS = "300000"

315> ```

316 316 

317Then retry in the same shell.317Then retry in the same shell.

318 318 


328 328 

329Set this variable to skip the re-clone attempt and keep using the existing checkout when the check can't reach the host:329Set this variable to skip the re-clone attempt and keep using the existing checkout when the check can't reach the host:

330 330 

331**Bash or Zsh**331> [tab] Bash or Zsh

332 332>

333```bash theme={null}333> ```bash theme={null}

334export CLAUDE_CODE_PLUGIN_KEEP_MARKETPLACE_ON_FAILURE=1334> export CLAUDE_CODE_PLUGIN_KEEP_MARKETPLACE_ON_FAILURE=1

335```335> ```

336 

337**PowerShell**

338 336 

339```powershell theme={null}337> [tab] PowerShell

340$env:CLAUDE_CODE_PLUGIN_KEEP_MARKETPLACE_ON_FAILURE = "1"338>

341```339> ```powershell theme={null}

340> $env:CLAUDE_CODE_PLUGIN_KEEP_MARKETPLACE_ON_FAILURE = "1"

341> ```

342 342 

343With the variable set, Claude Code skips the re-clone only for a checkout that already contains `.claude-plugin/marketplace.json`. A marketplace that was never cloned or whose clone stopped partway still gets the clone attempt, so add it once while online.343With the variable set, Claude Code skips the re-clone only for a checkout that already contains `.claude-plugin/marketplace.json`. A marketplace that was never cloned or whose clone stopped partway still gets the clone attempt, so add it once while online.

344 344 

quickstart.md +56 −56

Details

14 14 

15* A terminal or command prompt open15* A terminal or command prompt open

16* A code project to work with16* A code project to work with

17* A [Claude subscription](https://claude.com/pricing?utm_source=claude_code\&utm_medium=docs\&utm_content=quickstart_prereq) (Pro, Max, Team, or Enterprise), [Claude Console](https://platform.claude.com/) account, or access through a [supported cloud provider](https://code.claude.com/docs/en/third-party-integrations.md)17* A [Claude subscription](https://claude.com/pricing?utm_source=claude_code\&utm_medium=docs\&utm_content=quickstart_prereq) (Pro, Max, Ultra, Team, or Enterprise), [Claude Console](https://platform.claude.com/) account, or access through a [supported cloud provider](https://code.claude.com/docs/en/third-party-integrations.md)

18 18 

19> [!NOTE]19> [!NOTE]

20>20>


27 27 

28To install Claude Code, open a terminal and run the command for your system. If you haven't used a terminal before, the [terminal guide](https://code.claude.com/docs/en/terminal-guide) shows how to open one and paste the command.28To install Claude Code, open a terminal and run the command for your system. If you haven't used a terminal before, the [terminal guide](https://code.claude.com/docs/en/terminal-guide) shows how to open one and paste the command.

29 29 

30**Native Install (Recommended)**30> [tab] Native Install (Recommended)

31 

32**macOS, Linux, WSL:**

33 

34```bash theme={null}

35curl -fsSL https://claude.ai/install.sh | bash

36```

37 

38On Windows, your prompt shows `PS C:\` when you're in PowerShell and `C:\` without the `PS` when you're in CMD.

39 

40**Windows PowerShell:**

41 

42```powershell theme={null}

43irm https://claude.ai/install.ps1 | iex

44```

45 

46**Windows CMD:**

47 

48```batch theme={null}

49curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd

50```

51 

52The install command shows no progress while it downloads Claude Code. When the installer finishes, open a new terminal window and run `claude --version`. A working installation prints a version number. If your shell says `claude` isn't found or isn't recognized, the install directory isn't on your PATH yet: see [Fix your PATH](https://code.claude.com/docs/en/troubleshoot-install.md#command-not-found-claude-after-installation).

53 

54If you see `The token '&&' is not a valid statement separator`, you're in PowerShell, not CMD. If you see `'irm' is not recognized as an internal or external command`, you're in CMD, not PowerShell.

55 

56If the install command fails with `syntax error near unexpected token '<'`, a `403`, or any other error, see [Troubleshoot installation](https://code.claude.com/docs/en/troubleshoot-install.md#find-your-error) to match the error to a fix and for alternative install methods.

57 

58[Git for Windows](https://git-scm.com/downloads/win) is recommended on native Windows so Claude Code can use the Bash tool. If Git for Windows is not installed, Claude Code uses PowerShell as the shell tool instead. WSL setups do not need Git for Windows.

59 

60> [!NOTE]

61>31>

62> Native installations automatically update in the background to keep you on the latest version.32> **macOS, Linux, WSL:**

63 

64**Homebrew**

65 

66```bash theme={null}

67brew install --cask claude-code

68```

69 

70Homebrew offers two casks. `claude-code` tracks the stable release channel, which is typically about a week behind and skips releases with major regressions. `claude-code@latest` tracks the latest channel and receives new versions as soon as they ship.

71 

72> [!NOTE]

73>33>

74> Homebrew installations do not auto-update. Run `brew upgrade claude-code` or `brew upgrade claude-code@latest`, depending on which cask you installed, to get the latest features and security fixes.34> ```bash theme={null}

75 35> curl -fsSL https://claude.ai/install.sh | bash

76**WinGet**36> ```

37>

38> On Windows, your prompt shows `PS C:\` when you're in PowerShell and `C:\` without the `PS` when you're in CMD.

39>

40> **Windows PowerShell:**

41>

42> ```powershell theme={null}

43> irm https://claude.ai/install.ps1 | iex

44> ```

45>

46> **Windows CMD:**

47>

48> ```batch theme={null}

49> curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd

50> ```

51>

52> The install command shows no progress while it downloads Claude Code. When the installer finishes, open a new terminal window and run `claude --version`. A working installation prints a version number. If your shell says `claude` isn't found or isn't recognized, the install directory isn't on your PATH yet: see [Fix your PATH](https://code.claude.com/docs/en/troubleshoot-install.md#command-not-found-claude-after-installation).

53>

54> If you see `The token '&&' is not a valid statement separator`, you're in PowerShell, not CMD. If you see `'irm' is not recognized as an internal or external command`, you're in CMD, not PowerShell.

55>

56> If the install command fails with `syntax error near unexpected token '<'`, a `403`, or any other error, see [Troubleshoot installation](https://code.claude.com/docs/en/troubleshoot-install.md#find-your-error) to match the error to a fix and for alternative install methods.

57>

58> [Git for Windows](https://git-scm.com/downloads/win) is recommended on native Windows so Claude Code can use the Bash tool. If Git for Windows is not installed, Claude Code uses PowerShell as the shell tool instead. WSL setups do not need Git for Windows.

59>

60> > [!NOTE]

61> >

62> > Native installations automatically update in the background to keep you on the latest version.

77 63 

78```powershell theme={null}64> [tab] Homebrew

79winget install Anthropic.ClaudeCode65>

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

67> brew install --cask claude-code

68> ```

69>

70> Homebrew offers two casks. `claude-code` tracks the stable release channel, which is typically about a week behind and skips releases with major regressions. `claude-code@latest` tracks the latest channel and receives new versions as soon as they ship.

71>

72> > [!NOTE]

73> >

74> > Homebrew installations do not auto-update. Run `brew upgrade claude-code` or `brew upgrade claude-code@latest`, depending on which cask you installed, to get the latest features and security fixes.

81 75 

82> [!NOTE]76> [tab] WinGet

77>

78> ```powershell theme={null}

79> winget install Anthropic.ClaudeCode

80> ```

83>81>

84> WinGet installations do not auto-update. Run `winget upgrade Anthropic.ClaudeCode` periodically to get the latest features and security fixes.82> > [!NOTE]

83> >

84> > WinGet installations do not auto-update. Run `winget upgrade Anthropic.ClaudeCode` periodically to get the latest features and security fixes.

85 85 

86You can also install with [apt, dnf, or apk](https://code.claude.com/docs/en/setup.md#install-with-linux-package-managers) on Debian, Fedora, RHEL, and Alpine.86You can also install with [apt, dnf, or apk](https://code.claude.com/docs/en/setup.md#install-with-linux-package-managers) on Debian, Fedora, RHEL, and Alpine.

87 87 


108 108 

109You can log in using any of these account types:109You can log in using any of these account types:

110 110 

111* [Claude Pro, Max, Team, or Enterprise](https://claude.com/pricing?utm_source=claude_code\&utm_medium=docs\&utm_content=quickstart_login) (recommended)111* [Claude Pro, Max, Ultra, Team, or Enterprise](https://claude.com/pricing?utm_source=claude_code\&utm_medium=docs\&utm_content=quickstart_login) (recommended)

112* [Claude Console](https://platform.claude.com/) (API access with pre-paid credits). On first login, a "Claude Code" workspace is automatically created in the Console for centralized cost tracking.112* [Claude Console](https://platform.claude.com/) (API access with pre-paid credits). On first login, a "Claude Code" workspace is automatically created in the Console for centralized cost tracking.

113* [Amazon Bedrock, Google Cloud's Agent Platform, or Microsoft Foundry](https://code.claude.com/docs/en/third-party-integrations.md) (enterprise cloud providers)113* [Amazon Bedrock, Google Cloud's Agent Platform, or Microsoft Foundry](https://code.claude.com/docs/en/third-party-integrations.md) (enterprise cloud providers)

114* A self-hosted [Claude apps gateway](https://code.claude.com/docs/en/claude-apps-gateway), if your organization runs one: your admin pre-configures the gateway URL, and `/login` opens directly on the **Cloud gateway** screen for you to sign in with corporate SSO114* A self-hosted [Claude apps gateway](https://code.claude.com/docs/en/claude-apps-gateway), if your organization runs one: your admin pre-configures the gateway URL, and `/login` opens directly on the **Cloud gateway** screen for you to sign in with corporate SSO


267 267 

268For more, see [best practices](https://code.claude.com/docs/en/best-practices.md) and [common workflows](https://code.claude.com/docs/en/common-workflows.md).268For more, see [best practices](https://code.claude.com/docs/en/best-practices.md) and [common workflows](https://code.claude.com/docs/en/common-workflows.md).

269 269 

270> **Be specific with your requests**270> [accordion] Be specific with your requests

271>271>

272> Instead of: "fix the bug"272> Instead of: "fix the bug"

273>273>

274> Try: "fix the login bug where users see a blank screen after entering wrong credentials"274> Try: "fix the login bug where users see a blank screen after entering wrong credentials"

275 275 

276> **Use step-by-step instructions**276> [accordion] Use step-by-step instructions

277>277>

278> Break complex tasks into steps:278> Break complex tasks into steps:

279>279>


283> 3. build a webpage that allows users to see and edit their information283> 3. build a webpage that allows users to see and edit their information

284> ```284> ```

285 285 

286> **Let Claude explore first**286> [accordion] Let Claude explore first

287>287>

288> Before making changes, let Claude understand your code:288> Before making changes, let Claude understand your code:

289>289>


295> build a dashboard showing products that are most frequently returned by our UK customers295> build a dashboard showing products that are most frequently returned by our UK customers

296> ```296> ```

297 297 

298> **Save time with shortcuts**298> [accordion] Save time with shortcuts

299>299>

300> * Type `/` to see the commands and skills available to you300> * Type `/` to see the commands and skills available to you

301> * Use Tab for command completion301> * Use Tab for command completion

remote-control.md +97 −97

Details

25 25 

26Before using Remote Control, confirm that your environment meets these conditions:26Before using Remote Control, confirm that your environment meets these conditions:

27 27 

28* **Subscription**: available on Pro, Max, Team, and Enterprise plans. API keys are not supported. On Team and Enterprise, an Owner must first enable the Remote Control toggle in [Claude Code admin settings](https://claude.ai/admin-settings/claude-code).28* **Subscription**: available on Pro, Max, Ultra, Team, and Enterprise plans. API keys are not supported. On Team and Enterprise, an Owner must first enable the Remote Control toggle in [Claude Code admin settings](https://claude.ai/admin-settings/claude-code).

29* **Custom roles**: if your Enterprise organization manages your access with [custom roles](https://support.claude.com/en/articles/13930452), your roles must give you both the cloud sessions permission and the **Claude Code remote control** permission. If either is missing, starting Remote Control shows [`Remote Control is disabled by your organization's policy`](#remote-control-is-disabled-by-your-organizations-policy). Ask an Owner to check your roles and add what's missing at [**Organization settings > Roles**](https://claude.ai/admin-settings/roles).29* **Custom roles**: if your Enterprise organization manages your access with [custom roles](https://support.claude.com/en/articles/13930452), your roles must give you both the cloud sessions permission and the **Claude Code remote control** permission. If either is missing, starting Remote Control shows [`Remote Control is disabled by your organization's policy`](#remote-control-is-disabled-by-your-organizations-policy). Ask an Owner to check your roles and add what's missing at [**Organization settings > Roles**](https://claude.ai/admin-settings/roles).

30* **Authentication**: run `claude` and use `/login` to sign in through claude.ai if you haven't already. Without an eligible login, `claude remote-control` exits with an error, while `claude --remote-control` still starts an interactive session and shows a Remote Control failure notification shortly after launch.30* **Authentication**: run `claude` and use `/login` to sign in through claude.ai if you haven't already. Without an eligible login, `claude remote-control` exits with an error, while `claude --remote-control` still starts an interactive session and shows a Remote Control failure notification shortly after launch.

31* **API endpoint**: not available in any of these configurations:31* **API endpoint**: not available in any of these configurations:


41 41 

42You can start a Remote Control session from the CLI, the [Claude Desktop app](https://code.claude.com/docs/en/desktop.md), or the VS Code extension. The CLI offers three invocation modes; the Desktop app and VS Code use the `/remote-control` command.42You can start a Remote Control session from the CLI, the [Claude Desktop app](https://code.claude.com/docs/en/desktop.md), or the VS Code extension. The CLI offers three invocation modes; the Desktop app and VS Code use the `/remote-control` command.

43 43 

44**Server mode**44> [tab] Server mode

45 45>

46In your project directory, run:46> In your project directory, run:

47 47>

48```bash theme={null}48> ```bash theme={null}

49claude remote-control49> claude remote-control

50```50> ```

51 51>

52Until you accept Remote Control's one-time confirmation, `claude remote-control` explains what it does and asks `Enable Remote Control? (y/n)` before starting the server. Answer `y` to accept and start the server. If you decline, Claude Code exits without starting the server and asks again the next time you run the command.52> Until you accept Remote Control's one-time confirmation, `claude remote-control` explains what it does and asks `Enable Remote Control? (y/n)` before starting the server. Answer `y` to accept and start the server. If you decline, Claude Code exits without starting the server and asks again the next time you run the command.

53 53>

54The process stays running in your terminal in server mode, waiting for remote connections. It displays a session URL you can use to [connect from another device](#connect-from-another-device), and you can press spacebar to show a QR code for quick access from your phone. While a remote session is active, the terminal shows connection status and tool activity.54> The process stays running in your terminal in server mode, waiting for remote connections. It displays a session URL you can use to [connect from another device](#connect-from-another-device), and you can press spacebar to show a QR code for quick access from your phone. While a remote session is active, the terminal shows connection status and tool activity.

55 55>

56Pass any of these flags after `remote-control`:56> Pass any of these flags after `remote-control`:

57 57>

58| Flag | Description |58> | Flag | Description |

59| - | - |59> | - | - |

60| `--name "My Project"` | Set a custom session title visible in the session list at claude.ai/code. |60> | `--name "My Project"` | Set a custom session title visible in the session list at claude.ai/code. |

61| `--remote-control-session-name-prefix <prefix>` | Prefix for auto-generated 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. |61> | `--remote-control-session-name-prefix <prefix>` | Prefix for auto-generated 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. |

62| `-c`, `--continue` | Bring back the session that the last server in this directory started with, instead of creating a new one. See [Resume sessions after stopping the server](#resume-sessions-after-stopping-the-server). Can't be combined with `--session-id`, `--spawn`, `--capacity`, or `--create-session-in-dir`. Requires Claude Code v2.1.200 or later. |62> | `-c`, `--continue` | Bring back the session that the last server in this directory started with, instead of creating a new one. See [Resume sessions after stopping the server](#resume-sessions-after-stopping-the-server). Can't be combined with `--session-id`, `--spawn`, `--capacity`, or `--create-session-in-dir`. Requires Claude Code v2.1.200 or later. |

63| `--session-id <id>` | Bring back one session by its ID. See [Resume sessions after stopping the server](#resume-sessions-after-stopping-the-server). Can't be combined with `--continue`, `--spawn`, `--capacity`, or `--create-session-in-dir`. Requires Claude Code v2.1.200 or later. |63> | `--session-id <id>` | Bring back one session by its ID. See [Resume sessions after stopping the server](#resume-sessions-after-stopping-the-server). Can't be combined with `--continue`, `--spawn`, `--capacity`, or `--create-session-in-dir`. Requires Claude Code v2.1.200 or later. |

64| `--spawn <mode>` | How the server creates sessions. • `same-dir` (default when no mode is saved): all sessions share the current working directory, so they can conflict if editing the same files. • `worktree`: each on-demand session gets its own [git worktree](https://code.claude.com/docs/en/worktrees.md). Requires a git repository or a [`WorktreeCreate` hook](https://code.claude.com/docs/en/hooks#worktreecreate). • `session`: single-session mode. Serves exactly one session and rejects additional connections. Set at startup only. Press `w` at runtime to toggle between `same-dir` and `worktree`. The mode you switch to becomes the [default for this project](#set-the-default-spawn-mode-for-a-project). |64> | `--spawn <mode>` | How the server creates sessions. • `same-dir` (default when no mode is saved): all sessions share the current working directory, so they can conflict if editing the same files. • `worktree`: each on-demand session gets its own [git worktree](https://code.claude.com/docs/en/worktrees.md). Requires a git repository or a [`WorktreeCreate` hook](https://code.claude.com/docs/en/hooks#worktreecreate). • `session`: single-session mode. Serves exactly one session and rejects additional connections. Set at startup only. Press `w` at runtime to toggle between `same-dir` and `worktree`. The mode you switch to becomes the [default for this project](#set-the-default-spawn-mode-for-a-project). |

65| `--capacity <N>` | Maximum number of concurrent sessions. Default is 32. Cannot be used with `--spawn=session`. |65> | `--capacity <N>` | Maximum number of concurrent sessions. Default is 32. Cannot be used with `--spawn=session`. |

66| `--[no-]create-session-in-dir` | Pre-create one session in the current directory when the server starts, so you have somewhere to type immediately. In `worktree` mode this session stays in the current directory while on-demand sessions get isolated worktrees. On by default. If you pass `--no-create-session-in-dir` to start with none, Claude Code archives the server's sessions when you stop it, so there's nothing to [resume](#resume-sessions-after-stopping-the-server). |66> | `--[no-]create-session-in-dir` | Pre-create one session in the current directory when the server starts, so you have somewhere to type immediately. In `worktree` mode this session stays in the current directory while on-demand sessions get isolated worktrees. On by default. If you pass `--no-create-session-in-dir` to start with none, Claude Code archives the server's sessions when you stop it, so there's nothing to [resume](#resume-sessions-after-stopping-the-server). |

67| `--permission-mode <mode>` | Set the starting [permission mode](https://code.claude.com/docs/en/permission-modes.md) for the server's sessions, such as `acceptEdits`. Accepts `manual` as an alias for `default`; an unrecognized mode stops the server at startup and lists the valid modes. |67> | `--permission-mode <mode>` | Set the starting [permission mode](https://code.claude.com/docs/en/permission-modes.md) for the server's sessions, such as `acceptEdits`. Accepts `manual` as an alias for `default`; an unrecognized mode stops the server at startup and lists the valid modes. |

68| `--chrome` / `--no-chrome` | Turn [Chrome integration](https://code.claude.com/docs/en/chrome.md) on or off in the sessions the server creates, so Claude can use Chrome on your machine while you work from another device. Without either flag, the session the server pre-creates and any session you start yourself from claude.ai/code or the Claude app begin with Chrome off, even if you [enabled Chrome by default](https://code.claude.com/docs/en/chrome.md#enable-chrome-by-default). A session the server starts for one of your [project](https://code.claude.com/docs/en/claude-projects.md) threads follows that setting instead, except in `bypassPermissions` mode. Requires Claude Code v2.1.273 or later. |68> | `--chrome` / `--no-chrome` | Turn [Chrome integration](https://code.claude.com/docs/en/chrome.md) on or off in the sessions the server creates, so Claude can use Chrome on your machine while you work from another device. Without either flag, the session the server pre-creates and any session you start yourself from claude.ai/code or the Claude app begin with Chrome off, even if you [enabled Chrome by default](https://code.claude.com/docs/en/chrome.md#enable-chrome-by-default). A session the server starts for one of your [project](https://code.claude.com/docs/en/claude-projects.md) threads follows that setting instead, except in `bypassPermissions` mode. Requires Claude Code v2.1.273 or later. |

69| `-d`, `--debug[=<filter>]` | Turn on debug logging for the server, optionally filtered by category. Pass a filter only in the `=` form, such as `--debug=api,hooks`. Requires Claude Code v2.1.282 or later. |69> | `-d`, `--debug[=<filter>]` | Turn on debug logging for the server, optionally filtered by category. Pass a filter only in the `=` form, such as `--debug=api,hooks`. Requires Claude Code v2.1.282 or later. |

70| `--debug-file <path>` | Write debug logs to the given file. |70> | `--debug-file <path>` | Write debug logs to the given file. |

71| `--verbose` | Show detailed connection and session logs. |71> | `--verbose` | Show detailed connection and session logs. |

72| `--sandbox`, `--no-sandbox` | Removed in v2.1.300. If you pass either flag, the server [exits with an error](https://code.claude.com/docs/en/errors.md#sandbox-is-not-supported-by-claude-remote-control) instead of starting. |72> | `--sandbox`, `--no-sandbox` | Removed in v2.1.300. If you pass either flag, the server [exits with an error](https://code.claude.com/docs/en/errors.md#sandbox-is-not-supported-by-claude-remote-control) instead of starting. |

73 73>

74If you pass a global `claude` flag before `remote-control`, or a wrapper script adds one, Claude Code doesn't carry the flag over to the sessions the server creates. Claude Code lets the flag through only when dropping it is known not to change what those sessions can do, such as `--verbose` or `--model`. For any other flag, such as `--settings`, Claude Code [refuses to start](https://code.claude.com/docs/en/errors.md#not-carried-over-to-the-sessions-remote-control-starts) and names the flag to remove.74> If you pass a global `claude` flag before `remote-control`, or a wrapper script adds one, Claude Code doesn't carry the flag over to the sessions the server creates. Claude Code lets the flag through only when dropping it is known not to change what those sessions can do, such as `--verbose` or `--model`. For any other flag, such as `--settings`, Claude Code [refuses to start](https://code.claude.com/docs/en/errors.md#not-carried-over-to-the-sessions-remote-control-starts) and names the flag to remove.

75 75>

76To sandbox the sessions the server starts, turn on [sandboxing](https://code.claude.com/docs/en/sandboxing.md) in a settings file.76> To sandbox the sessions the server starts, turn on [sandboxing](https://code.claude.com/docs/en/sandboxing.md) in a settings file.

77 77>

78To print the `remote-control` flags in your terminal, run `claude remote-control --help`. Before v2.1.302, without an eligible sign-in the command returned one of the errors under [Troubleshooting](#troubleshooting) instead.78> To print the `remote-control` flags in your terminal, run `claude remote-control --help`. Before v2.1.302, without an eligible sign-in the command returned one of the errors under [Troubleshooting](#troubleshooting) instead.

79 

80**Interactive session**

81 

82To start a normal interactive Claude Code session with Remote Control enabled, use the `--remote-control` flag (or `--rc`):

83 

84```bash theme={null}

85claude --remote-control

86```

87 

88Optionally pass a name for the session:

89 

90```bash theme={null}

91claude --remote-control "My Project"

92```

93 

94This gives you a full interactive session in your terminal that you can also control from claude.ai or the Claude app. Unlike `claude remote-control` (server mode), you can type messages locally while the session is also available remotely.

95 

96**From an existing session**

97 

98If you're already in a Claude Code session and want to continue it remotely, use the `/remote-control` (or `/rc`) command:

99 

100```text theme={null}

101/remote-control

102```

103 

104Pass a name as an argument to set a custom session title:

105 

106```text theme={null}

107/remote-control My Project

108```

109 

110This starts a Remote Control session that carries over your current conversation history.

111 

112Until you accept Remote Control's one-time confirmation, a dialog appears before `/remote-control` connects. Select **Enable Remote Control** to accept and connect. If you select **Never mind** or press Esc, Claude Code doesn't connect and asks again the next time you run `/remote-control`.

113 

114The `--verbose` flag is not available with this command.

115 

116**VS Code**

117 

118In the [Claude Code VS Code extension](https://code.claude.com/docs/en/vs-code.md), type `/remote-control` or `/rc` in the prompt box.

119 

120```text theme={null}

121/remote-control

122```

123 

124While Remote Control is on, Claude Code shows a **Remote Control** indicator in the prompt box footer. Once the session connects, click the indicator to go directly to the session, or find it in the session list at [claude.ai/code](https://claude.ai/code). Claude Code also posts the session URL in the conversation. To disconnect, run `/remote-control` again.

125 

126Unlike the CLI, the VS Code command does not accept a name argument or display a QR code. The session title is derived from your conversation history or first prompt.

127 

128**Desktop app**

129 79 

130In a local session in the [Claude Desktop app's](https://code.claude.com/docs/en/desktop.md) Code tab, type `/remote-control` or `/rc` in the prompt box.80> [tab] Interactive session

81>

82> To start a normal interactive Claude Code session with Remote Control enabled, use the `--remote-control` flag (or `--rc`):

83>

84> ```bash theme={null}

85> claude --remote-control

86> ```

87>

88> Optionally pass a name for the session:

89>

90> ```bash theme={null}

91> claude --remote-control "My Project"

92> ```

93>

94> This gives you a full interactive session in your terminal that you can also control from claude.ai or the Claude app. Unlike `claude remote-control` (server mode), you can type messages locally while the session is also available remotely.

131 95 

132```text theme={null}96> [tab] From an existing session

133/remote-control97>

134```98> If you're already in a Claude Code session and want to continue it remotely, use the `/remote-control` (or `/rc`) command:

99>

100> ```text theme={null}

101> /remote-control

102> ```

103>

104> Pass a name as an argument to set a custom session title:

105>

106> ```text theme={null}

107> /remote-control My Project

108> ```

109>

110> This starts a Remote Control session that carries over your current conversation history.

111>

112> Until you accept Remote Control's one-time confirmation, a dialog appears before `/remote-control` connects. Select **Enable Remote Control** to accept and connect. If you select **Never mind** or press Esc, Claude Code doesn't connect and asks again the next time you run `/remote-control`.

113>

114> The `--verbose` flag is not available with this command.

135 115 

136Once the session connects, find it in the session list at [claude.ai/code](https://claude.ai/code). To disconnect, run `/remote-control` again.116> [tab] VS Code

117>

118> In the [Claude Code VS Code extension](https://code.claude.com/docs/en/vs-code.md), type `/remote-control` or `/rc` in the prompt box.

119>

120> ```text theme={null}

121> /remote-control

122> ```

123>

124> While Remote Control is on, Claude Code shows a **Remote Control** indicator in the prompt box footer. Once the session connects, click the indicator to go directly to the session, or find it in the session list at [claude.ai/code](https://claude.ai/code). Claude Code also posts the session URL in the conversation. To disconnect, run `/remote-control` again.

125>

126> Unlike the CLI, the VS Code command does not accept a name argument or display a QR code. The session title is derived from your conversation history or first prompt.

137 127 

138To turn Remote Control on for every session by default instead, see [Enable Remote Control for all sessions](#enable-remote-control-for-all-sessions).128> [tab] Desktop app

129>

130> In a local session in the [Claude Desktop app's](https://code.claude.com/docs/en/desktop.md) Code tab, type `/remote-control` or `/rc` in the prompt box.

131>

132> ```text theme={null}

133> /remote-control

134> ```

135>

136> Once the session connects, find it in the session list at [claude.ai/code](https://claude.ai/code). To disconnect, run `/remote-control` again.

137>

138> To turn Remote Control on for every session by default instead, see [Enable Remote Control for all sessions](#enable-remote-control-for-all-sessions).

139 139 

140### Check connection status140### Check connection status

141 141 


250>250>

251> Trusted Devices is currently in beta. Features and functionality may evolve as the experience is refined.251> Trusted Devices is currently in beta. Features and functionality may evolve as the experience is refined.

252>252>

253> Trusted Devices is available on Pro, Max, Team, and Enterprise plans and is off by default. On Team and Enterprise plans, an Owner turns it on for the organization. On Pro and Max plans, you turn on **Require trusted devices** yourself in your settings, on the Cowork or Account page.253> Trusted Devices is available on Pro, Max, Ultra, Team, and Enterprise plans and is off by default. On Team and Enterprise plans, an Owner turns it on for the organization. On Pro, Max, and Ultra plans, you turn on **Require trusted devices** yourself in your settings, on the Cowork or Account page.

254 254 

255Trusted Devices requires each member of your organization, or you alone on a Pro or Max plan, to verify their device before they can view or steer Remote Control sessions from claude.ai, the Claude mobile apps, or Claude Desktop. It ties Remote Control access to a known device and a recent authentication, not just a signed-in account.255Trusted Devices requires a verified device before you can view or steer Remote Control sessions from claude.ai, the Claude mobile apps, or Claude Desktop. The requirement applies to each member of your organization, or you alone on a Pro, Max, or Ultra plan. It ties Remote Control access to a known device and a recent authentication, not just a signed-in account.

256 256 

257When the setting is on, interacting with a Remote Control session requires both of the following:257When the setting is on, interacting with a Remote Control session requires both of the following:

258 258 


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

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

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

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

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

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

316 316 


444An [environment variable](https://code.claude.com/docs/en/env-vars.md#features-that-need-feature-flag-fetching) that turns off feature-flag evaluation is set, and the full message names the variable Claude Code found. On versions before 2.1.154, the same configuration produces "Remote Control is not yet enabled for your account" instead. What to do depends on the variable the message names:444An [environment variable](https://code.claude.com/docs/en/env-vars.md#features-that-need-feature-flag-fetching) that turns off feature-flag evaluation is set, and the full message names the variable Claude Code found. On versions before 2.1.154, the same configuration produces "Remote Control is not yet enabled for your account" instead. What to do depends on the variable the message names:

445 445 

446* **`CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC` or `DISABLE_GROWTHBOOK`**: unset the variable wherever it's set, in your shell environment or in the `env` block of a [`settings.json` file](https://code.claude.com/docs/en/settings-reference#all-settings).446* **`CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC` or `DISABLE_GROWTHBOOK`**: unset the variable wherever it's set, in your shell environment or in the `env` block of a [`settings.json` file](https://code.claude.com/docs/en/settings-reference#all-settings).

447* **`DISABLE_TELEMETRY` or `DO_NOT_TRACK`**: on a Pro, Max, Team, or Enterprise plan with `DISABLE_GROWTHBOOK` unset, these variables leave Remote Control available unless your organization requires [Trusted Devices](#trusted-devices). If it does, unset the variable wherever it's set to use Remote Control. On v2.1.154 through v2.1.282, you see this message with either variable set, so update Claude Code to a version that meets the [requirement for these variables](#requirements).447* **`DISABLE_TELEMETRY` or `DO_NOT_TRACK`**: on a Pro, Max, Ultra, Team, or Enterprise plan with `DISABLE_GROWTHBOOK` unset, Remote Control stays available with these variables set, unless your organization requires [Trusted Devices](#trusted-devices). If it does, unset the variable wherever it's set to use Remote Control. On v2.1.154 through v2.1.282, you see this message with either variable set, so update Claude Code to a version that meets the [requirement for these variables](#requirements).

448 448 

449### "Remote Control is only available when using Claude via api.anthropic.com"449### "Remote Control is only available when using Claude via api.anthropic.com"

450 450 


457A policy blocks Remote Control. Check these causes in order:457A policy blocks Remote Control. Check these causes in order:

458 458 

459* **The error mentions `disableRemoteControl`**: your IT administrator has disabled Remote Control on this device through [managed settings](https://code.claude.com/docs/en/managed-settings.md), independent of the organization-wide toggle and of how you're signed in.459* **The error mentions `disableRemoteControl`**: your IT administrator has disabled Remote Control on this device through [managed settings](https://code.claude.com/docs/en/managed-settings.md), independent of the organization-wide toggle and of how you're signed in.

460* **Your claude.ai plan is Pro or Max**: Claude Code is still signed in under a Team or Enterprise organization from an earlier login, so it checks that organization's Remote Control policy. Run `/status` to see which plan and organization your sign-in uses. Run `claude auth logout` then `claude auth login` to sign in again under your current plan.460* **Your claude.ai plan is Pro, Max, or Ultra**: Claude Code is still signed in under a Team or Enterprise organization from an earlier login, so it checks that organization's Remote Control policy. Run `/status` to see which plan and organization your sign-in uses. Run `claude auth logout` then `claude auth login` to sign in again under your current plan.

461* **The message doesn't say to contact your organization admin**: your organization has the [HIPAA configuration](https://code.claude.com/docs/en/hipaa-setup.md) applied, which turns Remote Control off. To confirm, run `/status` and look for `HIPAA` on the `Organization configuration` line. An Owner sees the **Remote Control** toggle grayed out in [admin settings](https://claude.ai/admin-settings/claude-code) and can't turn it on. If you have questions about the configuration, ask an Owner, who can contact your organization's Anthropic account team. Before v2.1.267, this case showed "Remote Control isn't available for your organization due to its compliance policy" instead.461* **The message doesn't say to contact your organization admin**: your organization has the [HIPAA configuration](https://code.claude.com/docs/en/hipaa-setup.md) applied, which turns Remote Control off. To confirm, run `/status` and look for `HIPAA` on the `Organization configuration` line. An Owner sees the **Remote Control** toggle grayed out in [admin settings](https://claude.ai/admin-settings/claude-code) and can't turn it on. If you have questions about the configuration, ask an Owner, who can contact your organization's Anthropic account team. Before v2.1.267, this case showed "Remote Control isn't available for your organization due to its compliance policy" instead.

462* **Remote Control works for others in your organization but not for you**: if your Enterprise organization manages your access with [custom roles](https://support.claude.com/en/articles/13930452), your roles can be the cause. Remote Control needs both the cloud sessions permission and the **Claude Code remote control** permission. Ask an Owner to check whether your roles include both and add what's missing at [**Organization settings > Roles**](https://claude.ai/admin-settings/roles).462* **Remote Control works for others in your organization but not for you**: if your Enterprise organization manages your access with [custom roles](https://support.claude.com/en/articles/13930452), your roles can be the cause. Remote Control needs both the cloud sessions permission and the **Claude Code remote control** permission. Ask an Owner to check whether your roles include both and add what's missing at [**Organization settings > Roles**](https://claude.ai/admin-settings/roles).

463* **Otherwise, an Owner hasn't enabled it for your organization**: Remote Control is off by default on Team and Enterprise plans. An Owner can enable it at [claude.ai/admin-settings/claude-code](https://claude.ai/admin-settings/claude-code) by turning on the **Remote Control** toggle. This toggle is a server-side organization setting.463* **Otherwise, an Owner hasn't enabled it for your organization**: Remote Control is off by default on Team and Enterprise plans. An Owner can enable it at [claude.ai/admin-settings/claude-code](https://claude.ai/admin-settings/claude-code) by turning on the **Remote Control** toggle. This toggle is a server-side organization setting.

routines.md +11 −11

Details

25* A task with only an API trigger runs when you call its endpoint.25* A task with only an API trigger runs when you call its endpoint.

26* A task with only a GitHub trigger runs when a matching repository event occurs.26* A task with only a GitHub trigger runs when a matching repository event occurs.

27 27 

28Scheduled tasks are available on Pro, Max, Team, and Enterprise plans. Create and manage them at [claude.ai/code/routines](https://claude.ai/code/routines), or from the CLI with `/schedule`. The earlier name, routines, [still appears](#where-the-name-routines-still-appears).28Scheduled tasks are available on Pro, Max, Ultra, Team, and Enterprise plans. Create and manage them at [claude.ai/code/routines](https://claude.ai/code/routines), or from the CLI with `/schedule`. The earlier name, routines, [still appears](#where-the-name-routines-still-appears).

29 29 

30> [!NOTE]30> [!NOTE]

31>31>


85 85 

86In the **Trigger** row, choose how the task starts. To combine several triggers, click **+** at the end of the row.86In the **Trigger** row, choose how the task starts. To combine several triggers, click **+** at the end of the row.

87 87 

88**Schedule**88> [tab] Schedule

89 89>

90Pick a preset frequency for a recurring run. See [Add a schedule trigger](#add-a-schedule-trigger) for timezone handling, late starts, custom cron intervals, and one-off runs.90> Pick a preset frequency for a recurring run. See [Add a schedule trigger](#add-a-schedule-trigger) for timezone handling, late starts, custom cron intervals, and one-off runs.

91 

92**GitHub event**

93 

94Select the repository, the event to react to, and optional filters. See [Add a GitHub trigger](#add-a-github-trigger) for the full list of supported events and filter fields.

95 91 

96**API**92> [tab] GitHub event

93>

94> Select the repository, the event to react to, and optional filters. See [Add a GitHub trigger](#add-a-github-trigger) for the full list of supported events and filter fields.

97 95 

98Select **API** here. When you click **Create**, the **API token** dialog shows the token once, so copy it before you close the dialog. See [Add an API trigger](#add-an-api-trigger) to copy the URL or generate a new token.96> [tab] API

97>

98> Select **API** here. When you click **Create**, the **API token** dialog shows the token once, so copy it before you close the dialog. See [Add an API trigger](#add-an-api-trigger) to copy the URL or generate a new token.

99 99 

100**4. Select repositories**100**4. Select repositories**

101 101 


502* An Owner [turned off scheduled tasks](#routines-are-disabled-by-your-organizations-policy) for your Team or Enterprise organization. Before v2.1.227, the command still appeared in this case, and claude.ai rejected the task when Claude tried to create or run it502* An Owner [turned off scheduled tasks](#routines-are-disabled-by-your-organizations-policy) for your Team or Enterprise organization. Before v2.1.227, the command still appeared in this case, and claude.ai rejected the task when Claude tried to create or run it

503* Your Enterprise organization manages your access with [custom roles](https://support.claude.com/en/articles/13930452), and none of your roles includes the scheduled tasks permission under **Remote sessions**. Ask an Owner to add it to one of your roles503* Your Enterprise organization manages your access with [custom roles](https://support.claude.com/en/articles/13930452), and none of your roles includes the scheduled tasks permission under **Remote sessions**. Ask an Owner to add it to one of your roles

504 504 

505If the cause is your CLI sign-in or being inside a cloud session, you can still create and manage scheduled tasks at [claude.ai/code/routines](https://claude.ai/code/routines). You need a Pro, Max, Team, or Enterprise account there. If scheduled tasks or cloud sessions are off for your organization or missing from your roles, you can't create them on the web either.505If the cause is your CLI sign-in or being inside a cloud session, you can still create and manage scheduled tasks at [claude.ai/code/routines](https://claude.ai/code/routines). You need a Pro, Max, Ultra, Team, or Enterprise account there. If scheduled tasks or cloud sessions are off for your organization or missing from your roles, you can't create them on the web either.

506 506 

507### "Routines are disabled by your organization's policy"507### "Routines are disabled by your organization's policy"

508 508 

sandboxing.md +12 −12

Details

119 119 

120Install them with your distribution's package manager:120Install them with your distribution's package manager:

121 121 

122**Ubuntu/Debian**122> [tab] Ubuntu/Debian

123 123>

124```bash theme={null}124> ```bash theme={null}

125sudo apt-get install bubblewrap socat125> sudo apt-get install bubblewrap socat

126```126> ```

127 

128**Fedora**

129 127 

130```bash theme={null}128> [tab] Fedora

131sudo dnf install bubblewrap socat129>

132```130> ```bash theme={null}

131> sudo dnf install bubblewrap socat

132> ```

133 133 

134When a dependency is missing, the Dependencies tab in `/sandbox` lists which of `ripgrep`, `bubblewrap`, `socat`, and the seccomp filter your platform lacks. If you don't see the tab after installing and restarting Claude Code, all dependencies are present.134When a dependency is missing, the Dependencies tab in `/sandbox` lists which of `ripgrep`, `bubblewrap`, `socat`, and the seccomp filter your platform lacks. If you don't see the tab after installing and restarting Claude Code, all dependencies are present.

135 135 


137 137 

138When a required dependency is missing, the Dependencies tab is the only tab shown until you install it. When only the optional seccomp filter is missing, the Dependencies tab appears alongside the other tabs. The dependency check runs at startup, so restart Claude Code after installing packages for `/sandbox` to detect them.138When a required dependency is missing, the Dependencies tab is the only tab shown until you install it. When only the optional seccomp filter is missing, the Dependencies tab appears alongside the other tabs. The dependency check runs at startup, so restart Claude Code after installing packages for `/sandbox` to detect them.

139 139 

140> **Ubuntu 24.04 and later: allow bubblewrap to create user namespaces**140> [accordion] Ubuntu 24.04 and later: allow bubblewrap to create user namespaces

141>141>

142> On Ubuntu 24.04 and later, the default AppArmor policy prevents bubblewrap from creating the user namespaces it needs for isolation.142> On Ubuntu 24.04 and later, the default AppArmor policy prevents bubblewrap from creating the user namespaces it needs for isolation.

143>143>


161> sudo systemctl reload apparmor161> sudo systemctl reload apparmor

162> ```162> ```

163 163 

164> **WSL2 notes**164> [accordion] WSL2 notes

165>165>

166> Check your WSL version with `wsl -l -v` from PowerShell. If you see `Sandboxing requires WSL2`, your distribution is running WSL1. Upgrade it to WSL2 or run Claude Code without sandboxing.166> Check your WSL version with `wsl -l -v` from PowerShell. If you see `Sandboxing requires WSL2`, your distribution is running WSL1. Upgrade it to WSL2 or run Claude Code without sandboxing.

167>167>

security.md +1 −1

Details

53* Restricted access to user session data53* Restricted access to user session data

54* User control over data training preferences. Consumer users can change their [privacy settings](https://claude.ai/settings/privacy) at any time.54* User control over data training preferences. Consumer users can change their [privacy settings](https://claude.ai/settings/privacy) at any time.

55 55 

56For full details, please review our [Commercial Terms of Service](https://www.anthropic.com/legal/commercial-terms) (for Team, Enterprise, and API users) or [Consumer Terms](https://www.anthropic.com/legal/consumer-terms) (for Free, Pro, and Max users) and [Privacy Policy](https://www.anthropic.com/legal/privacy).56For full details, please review our [Commercial Terms of Service](https://www.anthropic.com/legal/commercial-terms) (for Team, Enterprise, and API users) or [Consumer Terms](https://www.anthropic.com/legal/consumer-terms) (for Free, Pro, Max, and Ultra users) and [Privacy Policy](https://www.anthropic.com/legal/privacy).

57 57 

58### Additional safeguards58### Additional safeguards

59 59 

Details

14 14 

15In a self-hosted environment, those same sessions execute inside your network. The developer experience is otherwise the same apart from the differences in [Availability and limitations](#availability-and-limitations) and the deploy page's [known issues](https://code.claude.com/docs/en/self-hosted-environments-deploy.md#known-issues-and-limitations).15In a self-hosted environment, those same sessions execute inside your network. The developer experience is otherwise the same apart from the differences in [Availability and limitations](#availability-and-limitations) and the deploy page's [known issues](https://code.claude.com/docs/en/self-hosted-environments-deploy.md#known-issues-and-limitations).

16 16 

17If your team doesn't use cloud sessions, there's nothing here to configure: sessions in a terminal or IDE always run on the developer's own machine. If you want to run Claude Code on your own always-on machine and drive it from other devices, use [Remote Control](https://code.claude.com/docs/en/remote-control.md), which is also available on Pro and Max plans. When you're ready to set up, go straight to the [quickstart](https://code.claude.com/docs/en/self-hosted-environments-quickstart.md); to review the security posture first, start with [Deploy to production](https://code.claude.com/docs/en/self-hosted-environments-deploy.md). The rest of this page explains how self-hosting works and when to choose it.17* If your team doesn't use cloud sessions, there's nothing here to configure: sessions in a terminal or IDE always run on the developer's own machine

18* To run Claude Code on your own always-on machine and drive it from other devices, use [Remote Control](https://code.claude.com/docs/en/remote-control.md), which is also available on Pro, Max, and Ultra plans

19* When you're ready to set up, go straight to the [quickstart](https://code.claude.com/docs/en/self-hosted-environments-quickstart.md); to review the security posture first, start with [Deploy to production](https://code.claude.com/docs/en/self-hosted-environments-deploy.md)

20 

21To learn how self-hosting works and when to choose it, read [How self-hosted environments work](#how-self-hosted-environments-work) and [Why self-host](#why-self-host).

18 22 

19## How self-hosted environments work23## How self-hosted environments work

20 24 

Details

531 531 

532Start these runners with [`--confine-repo-settings enforce`](https://code.claude.com/docs/en/self-hosted-environments-deploy#harden-your-deployment). It refuses sessions on repositories whose committed settings it flags, so run in the default `warn` mode first and clear what it logs.532Start these runners with [`--confine-repo-settings enforce`](https://code.claude.com/docs/en/self-hosted-environments-deploy#harden-your-deployment). It refuses sessions on repositories whose committed settings it flags, so run in the default `warn` mode first and clear what it logs.

533 533 

534**Amazon Bedrock**534> [tab] Amazon Bedrock

535 535>

536Replace the region with your own:536> Replace the region with your own:

537 537>

538```bash theme={null}538> ```bash theme={null}

539export CLAUDE_CODE_USE_BEDROCK=1539> export CLAUDE_CODE_USE_BEDROCK=1

540export AWS_REGION=us-east-1540> export AWS_REGION=us-east-1

541```541> ```

542 542>

543For how Claude Code resolves the region, see [Configure Claude Code](https://code.claude.com/docs/en/amazon-bedrock.md#3-configure-claude-code). For which inference profile prefix Claude Code uses for your region, see [Cross-region inference profile prefixes](https://code.claude.com/docs/en/amazon-bedrock.md#cross-region-inference-profile-prefixes).543> For how Claude Code resolves the region, see [Configure Claude Code](https://code.claude.com/docs/en/amazon-bedrock.md#3-configure-claude-code). For which inference profile prefix Claude Code uses for your region, see [Cross-region inference profile prefixes](https://code.claude.com/docs/en/amazon-bedrock.md#cross-region-inference-profile-prefixes).

544 

545**Google Cloud's Agent Platform**

546 

547Replace the region and project ID with your own:

548 

549```bash theme={null}

550export CLAUDE_CODE_USE_VERTEX=1

551export CLOUD_ML_REGION=global

552export ANTHROPIC_VERTEX_PROJECT_ID=YOUR-PROJECT-ID

553```

554 544 

555To choose a region, see [Region configuration](https://code.claude.com/docs/en/google-vertex-ai.md#region-configuration).545> [tab] Google Cloud's Agent Platform

546>

547> Replace the region and project ID with your own:

548>

549> ```bash theme={null}

550> export CLAUDE_CODE_USE_VERTEX=1

551> export CLOUD_ML_REGION=global

552> export ANTHROPIC_VERTEX_PROJECT_ID=YOUR-PROJECT-ID

553> ```

554>

555> To choose a region, see [Region configuration](https://code.claude.com/docs/en/google-vertex-ai.md#region-configuration).

556 556 

557**4. Check that the variables reached a session**557**4. Check that the variables reached a session**

558 558 

Details

90 90 

91The checks map directly onto standard JWT libraries. The examples below implement the full sequence in Node.js with [`jose`](https://www.npmjs.com/package/jose), which handles JWKS fetching, caching, and `kid` selection, and in Python with [`PyJWT`](https://pyjwt.readthedocs.io/) and its built-in JWKS client.91The checks map directly onto standard JWT libraries. The examples below implement the full sequence in Node.js with [`jose`](https://www.npmjs.com/package/jose), which handles JWKS fetching, caching, and `kid` selection, and in Python with [`PyJWT`](https://pyjwt.readthedocs.io/) and its built-in JWKS client.

92 92 

93**Node.js (jose)**93> [tab] Node.js (jose)

94 94>

95```typescript theme={null}95> ```typescript theme={null}

96import { createRemoteJWKSet, jwtVerify } from "jose";96> import { createRemoteJWKSet, jwtVerify } from "jose";

97 97>

98const JWKS = createRemoteJWKSet(98> const JWKS = createRemoteJWKSet(

99 new URL("https://api.anthropic.com/v1/code/.well-known/jwks.json")99> new URL("https://api.anthropic.com/v1/code/.well-known/jwks.json")

100);100> );

101 101>

102const PREFIX = "sk-ant-cc-";102> const PREFIX = "sk-ant-cc-";

103const EXPECTED_POOL_ID = "ccpool_...";103> const EXPECTED_POOL_ID = "ccpool_...";

104 104>

105export async function verifySessionToken(raw: string) {105> export async function verifySessionToken(raw: string) {

106 if (!raw.startsWith(PREFIX)) {106> if (!raw.startsWith(PREFIX)) {

107 throw new Error("not a self-hosted runner session token");107> throw new Error("not a self-hosted runner session token");

108 }108> }

109 const jwt = raw.slice(PREFIX.length);109> const jwt = raw.slice(PREFIX.length);

110 110>

111 const { payload } = await jwtVerify(jwt, JWKS, {111> const { payload } = await jwtVerify(jwt, JWKS, {

112 issuer: "ccr",112> issuer: "ccr",

113 audience: EXPECTED_POOL_ID,113> audience: EXPECTED_POOL_ID,

114 algorithms: ["ES256"],114> algorithms: ["ES256"],

115 });115> });

116 116>

117 if (payload["ccr:role"] !== "session_worker") {117> if (payload["ccr:role"] !== "session_worker") {

118 throw new Error("token is not a session_worker token");118> throw new Error("token is not a session_worker token");

119 }119> }

120 120>

121 const act = payload.act as { email?: string; sub?: string };121> const act = payload.act as { email?: string; sub?: string };

122 return {122> return {

123 sessionId: payload["ccr:session_id"] as string,123> sessionId: payload["ccr:session_id"] as string,

124 poolId: payload["ccr:pool_id"] as string,124> poolId: payload["ccr:pool_id"] as string,

125 orgId: payload["ccr:org_id"] as string,125> orgId: payload["ccr:org_id"] as string,

126 creatorEmail: act?.email,126> creatorEmail: act?.email,

127 creatorSub: act?.sub,127> creatorSub: act?.sub,

128 };128> };

129}129> }

130```130> ```

131 131 

132**Python (PyJWT)**132> [tab] Python (PyJWT)

133 133>

134```python theme={null}134> ```python theme={null}

135import jwt135> import jwt

136from jwt import PyJWKClient136> from jwt import PyJWKClient

137 137>

138JWKS_URL = "https://api.anthropic.com/v1/code/.well-known/jwks.json"138> JWKS_URL = "https://api.anthropic.com/v1/code/.well-known/jwks.json"

139PREFIX = "sk-ant-cc-"139> PREFIX = "sk-ant-cc-"

140EXPECTED_POOL_ID = "ccpool_..."140> EXPECTED_POOL_ID = "ccpool_..."

141 141>

142jwks = PyJWKClient(JWKS_URL)142> jwks = PyJWKClient(JWKS_URL)

143 143>

144 144>

145def verify_session_token(raw: str) -> dict:145> def verify_session_token(raw: str) -> dict:

146 if not raw.startswith(PREFIX):146> if not raw.startswith(PREFIX):

147 raise ValueError("not a self-hosted runner session token")147> raise ValueError("not a self-hosted runner session token")

148 token = raw.removeprefix(PREFIX)148> token = raw.removeprefix(PREFIX)

149 149>

150 signing_key = jwks.get_signing_key_from_jwt(token)150> signing_key = jwks.get_signing_key_from_jwt(token)

151 payload = jwt.decode(151> payload = jwt.decode(

152 token,152> token,

153 signing_key.key,153> signing_key.key,

154 algorithms=["ES256"],154> algorithms=["ES256"],

155 issuer="ccr",155> issuer="ccr",

156 audience=EXPECTED_POOL_ID,156> audience=EXPECTED_POOL_ID,

157 )157> )

158 158>

159 if payload.get("ccr:role") != "session_worker":159> if payload.get("ccr:role") != "session_worker":

160 raise ValueError("token is not a session_worker token")160> raise ValueError("token is not a session_worker token")

161 161>

162 act = payload.get("act") or {}162> act = payload.get("act") or {}

163 return {163> return {

164 "session_id": payload["ccr:session_id"],164> "session_id": payload["ccr:session_id"],

165 "pool_id": payload["ccr:pool_id"],165> "pool_id": payload["ccr:pool_id"],

166 "org_id": payload["ccr:org_id"],166> "org_id": payload["ccr:org_id"],

167 "creator_email": act.get("email"),167> "creator_email": act.get("email"),

168 "creator_sub": act.get("sub"),168> "creator_sub": act.get("sub"),

169 }169> }

170```170> ```

171 171 

172### Verify the token inside the session172### Verify the token inside the session

173 173 

sessions.md +1 −1

Details

95 95 

96If you see the "Resume this conversation?" dialog when resuming a session, its estimate is the share of your 5-hour usage limit that the saved conversation alone would use. The estimate doesn't count what you've already used.96If you see the "Resume this conversation?" dialog when resuming a session, its estimate is the share of your 5-hour usage limit that the saved conversation alone would use. The estimate doesn't count what you've already used.

97 97 

98On Pro and Max plans, the dialog can appear when you resume a long conversation [after a long break](https://code.claude.com/docs/en/prompt-caching.md#resuming-a-session) or on a different model. The estimated use comes when you send your first message after **Resume**, not when you select it. Choose by whether your next task still needs the saved conversation:98On Pro, Max, and Ultra plans, the dialog can appear when you resume a long conversation [after a long break](https://code.claude.com/docs/en/prompt-caching.md#resuming-a-session) or on a different model. The estimated use comes when you send your first message after **Resume**, not when you select it. Choose by whether your next task still needs the saved conversation:

99 99 

100* **Resume**: keep working in the saved conversation.100* **Resume**: keep working in the saved conversation.

101* **Start a new conversation**: switch to work that doesn't need the saved conversation. To reopen it later, run [`/resume`](#use-the-session-picker) at the prompt. The estimate doesn't apply to your first message in the new conversation. If the option says that Claude can look up this conversation, you can still refer to earlier work in the new conversation.101* **Start a new conversation**: switch to work that doesn't need the saved conversation. To reopen it later, run [`/resume`](#use-the-session-picker) at the prompt. The estimate doesn't apply to your first message in the new conversation. If the option says that Claude can look up this conversation, you can still refer to earlier work in the new conversation.

settings-example.md +325 −325

Details

20 20 

21One developer's personal settings. It picks a model and effort, adjusts the terminal, and pre-approves a read-only command and one file read. Everything not listed keeps its default. A file like this goes in `~/.claude/settings.json`, where it applies to every project you open.21One developer's personal settings. It picks a model and effort, adjusts the terminal, and pre-approves a read-only command and one file read. Everything not listed keeps its default. A file like this goes in `~/.claude/settings.json`, where it applies to every project you open.

22 22 

23**Copyable settings file**23> [tab] Copyable settings file

24 24>

25Save this as `~/.claude/settings.json`. It's valid JSON with no comments, so you can paste it as is and delete the keys you don't want.25> Save this as `~/.claude/settings.json`. It's valid JSON with no comments, so you can paste it as is and delete the keys you don't want.

26 26>

27```json ~/.claude/settings.json theme={null}27> ```json ~/.claude/settings.json theme={null}

28{28> {

29 "model": "claude-sonnet-5",29> "model": "claude-sonnet-5",

30 "modelSettings": {30> "modelSettings": {

31 "claude-sonnet-5": { "effortLevel": "xhigh" }31> "claude-sonnet-5": { "effortLevel": "xhigh" }

32 },32> },

33 "editorMode": "vim",33> "editorMode": "vim",

34 "theme": "light-daltonized",34> "theme": "light-daltonized",

35 "statusLine": {35> "statusLine": {

36 "type": "command",36> "type": "command",

37 "command": "jq -r '\"[\\(.model.display_name)] \\(.context_window.used_percentage // 0)% context\"'",37> "command": "jq -r '\"[\\(.model.display_name)] \\(.context_window.used_percentage // 0)% context\"'",

38 "padding": 238> "padding": 2

39 },39> },

40 "spinnerTipsEnabled": false,40> "spinnerTipsEnabled": false,

41 "preferredNotifChannel": "terminal_bell",41> "preferredNotifChannel": "terminal_bell",

42 "permissions": {42> "permissions": {

43 "allow": [43> "allow": [

44 "Bash(git diff *)",44> "Bash(git diff *)",

45 "Read(~/.zshrc)"45> "Read(~/.zshrc)"

46 ]46> ]

47 },47> },

48 "autoUpdatesChannel": "stable",48> "autoUpdatesChannel": "stable",

49 "cleanupPeriodDays": 2049> "cleanupPeriodDays": 20

50}50> }

51```51> ```

52 52 

53**What each key does**53> [tab] What each key does

54 54>

55The same file with a comment above each key. Read it here; copy from the other tab, because Claude Code doesn't accept comments in a settings file.55> The same file with a comment above each key. Read it here; copy from the other tab, because Claude Code doesn't accept comments in a settings file.

56 56>

57```jsonc ~/.claude/settings.json theme={null}57> ```jsonc ~/.claude/settings.json theme={null}

58{58> {

59 // Start every session on Sonnet 559> // Start every session on Sonnet 5

60 "model": "claude-sonnet-5",60> "model": "claude-sonnet-5",

61 // Run Sonnet 5 above its default high level; /effort saves a level per model, and --effort sets one for a single session61> // Run Sonnet 5 above its default high level; /effort saves a level per model, and --effort sets one for a single session

62 "modelSettings": {62> "modelSettings": {

63 "claude-sonnet-5": { "effortLevel": "xhigh" }63> "claude-sonnet-5": { "effortLevel": "xhigh" }

64 },64> },

65 // Vim keybindings in the prompt65> // Vim keybindings in the prompt

66 "editorMode": "vim",66> "editorMode": "vim",

67 // The colorblind-friendly light theme67> // The colorblind-friendly light theme

68 "theme": "light-daltonized",68> "theme": "light-daltonized",

69 // A status line below the prompt: model name and context used69> // A status line below the prompt: model name and context used

70 "statusLine": {70> "statusLine": {

71 "type": "command",71> "type": "command",

72 "command": "jq -r '\"[\\(.model.display_name)] \\(.context_window.used_percentage // 0)% context\"'",72> "command": "jq -r '\"[\\(.model.display_name)] \\(.context_window.used_percentage // 0)% context\"'",

73 "padding": 273> "padding": 2

74 },74> },

75 // Hide the tips that rotate under the spinner75> // Hide the tips that rotate under the spinner

76 "spinnerTipsEnabled": false,76> "spinnerTipsEnabled": false,

77 // Ring the terminal bell for notifications, such as a finished task or a waiting permission prompt77> // Ring the terminal bell for notifications, such as a finished task or a waiting permission prompt

78 "preferredNotifChannel": "terminal_bell",78> "preferredNotifChannel": "terminal_bell",

79 // Let Claude Code run git diff and read your .zshrc without asking79> // Let Claude Code run git diff and read your .zshrc without asking

80 "permissions": {80> "permissions": {

81 "allow": [81> "allow": [

82 "Bash(git diff *)",82> "Bash(git diff *)",

83 "Read(~/.zshrc)"83> "Read(~/.zshrc)"

84 ]84> ]

85 },85> },

86 // Take updates from the stable channel86> // Take updates from the stable channel

87 "autoUpdatesChannel": "stable",87> "autoUpdatesChannel": "stable",

88 // Delete session transcripts and other local session data older than 20 days88> // Delete session transcripts and other local session data older than 20 days

89 "cleanupPeriodDays": 2089> "cleanupPeriodDays": 20

90}90> }

91```91> ```

92 92 

93## A team's shared settings93## A team's shared settings

94 94 


100* **The hook is a script in the repo.** This file's hook runs `.claude/hooks/block-rm.sh`; [How a hook resolves](https://code.claude.com/docs/en/hooks.md#how-a-hook-resolves) walks through writing it.100* **The hook is a script in the repo.** This file's hook runs `.claude/hooks/block-rm.sh`; [How a hook resolves](https://code.claude.com/docs/en/hooks.md#how-a-hook-resolves) walks through writing it.

101* **Rules match the command and path as written.** `Bash(git push *)` doesn't match [`git -C . push`](https://code.claude.com/docs/en/permissions#bash-rule-limits). `Read(./.env)` on its own stops the file tools and commands that name the file, such as `cat .env`, but not [`grep -r` run over the directory](https://code.claude.com/docs/en/permissions#read-and-edit); the `sandbox` block in this file closes that gap, because the sandbox [adds your `Read` deny paths](https://code.claude.com/docs/en/settings-reference#sandbox-filesystem-denyread) to what every sandboxed command can't read.101* **Rules match the command and path as written.** `Bash(git push *)` doesn't match [`git -C . push`](https://code.claude.com/docs/en/permissions#bash-rule-limits). `Read(./.env)` on its own stops the file tools and commands that name the file, such as `cat .env`, but not [`grep -r` run over the directory](https://code.claude.com/docs/en/permissions#read-and-edit); the `sandbox` block in this file closes that gap, because the sandbox [adds your `Read` deny paths](https://code.claude.com/docs/en/settings-reference#sandbox-filesystem-denyread) to what every sandboxed command can't read.

102 102 

103**Copyable settings file**103> [tab] Copyable settings file

104 104>

105Save this as `.claude/settings.json` at the top of the repository and commit it. It's valid JSON with no comments, so you can paste it as is and delete the keys you don't want.105> Save this as `.claude/settings.json` at the top of the repository and commit it. It's valid JSON with no comments, so you can paste it as is and delete the keys you don't want.

106 106>

107```json .claude/settings.json theme={null}107> ```json .claude/settings.json theme={null}

108{108> {

109 "permissions": {109> "permissions": {

110 "allow": [110> "allow": [

111 "Bash(npm run *)"111> "Bash(npm run *)"

112 ],112> ],

113 "ask": [113> "ask": [

114 "Bash(git push *)"114> "Bash(git push *)"

115 ],115> ],

116 "deny": [116> "deny": [

117 "Read(./.env)",117> "Read(./.env)",

118 "Read(./.env.*)",118> "Read(./.env.*)",

119 "Read(./secrets/**)"119> "Read(./secrets/**)"

120 ]120> ]

121 },121> },

122 "hooks": {122> "hooks": {

123 "PreToolUse": [123> "PreToolUse": [

124 {124> {

125 "matcher": "Bash",125> "matcher": "Bash",

126 "hooks": [126> "hooks": [

127 {127> {

128 "type": "command",128> "type": "command",

129 "command": "${CLAUDE_PROJECT_DIR}/.claude/hooks/block-rm.sh"129> "command": "${CLAUDE_PROJECT_DIR}/.claude/hooks/block-rm.sh"

130 }130> }

131 ]131> ]

132 }132> }

133 ]133> ]

134 },134> },

135 "extraKnownMarketplaces": {135> "extraKnownMarketplaces": {

136 "acme-tools": {136> "acme-tools": {

137 "source": {137> "source": {

138 "source": "github",138> "source": "github",

139 "repo": "acme-corp/claude-plugins"139> "repo": "acme-corp/claude-plugins"

140 }140> }

141 }141> }

142 },142> },

143 "enabledPlugins": {143> "enabledPlugins": {

144 "code-formatter@acme-tools": true144> "code-formatter@acme-tools": true

145 },145> },

146 "sandbox": {146> "sandbox": {

147 "enabled": true,147> "enabled": true,

148 "filesystem": {148> "filesystem": {

149 "allowWrite": [149> "allowWrite": [

150 "/tmp/build"150> "/tmp/build"

151 ]151> ]

152 },152> },

153 "network": {153> "network": {

154 "allowedDomains": [154> "allowedDomains": [

155 "registry.npmjs.org",155> "registry.npmjs.org",

156 "*.example.com"156> "*.example.com"

157 ]157> ]

158 }158> }

159 },159> },

160 "plansDirectory": "./plans"160> "plansDirectory": "./plans"

161}161> }

162```162> ```

163 163 

164**What each key does**164> [tab] What each key does

165 165>

166The same file with a comment above each key. Read it here; copy from the other tab, because Claude Code doesn't accept comments in a settings file.166> The same file with a comment above each key. Read it here; copy from the other tab, because Claude Code doesn't accept comments in a settings file.

167 167>

168```jsonc .claude/settings.json theme={null}168> ```jsonc .claude/settings.json theme={null}

169{169> {

170 "permissions": {170> "permissions": {

171 // Run npm scripts without asking171> // Run npm scripts without asking

172 "allow": [172> "allow": [

173 "Bash(npm run *)"173> "Bash(npm run *)"

174 ],174> ],

175 // Confirm before git push commands175> // Confirm before git push commands

176 "ask": [176> "ask": [

177 "Bash(git push *)"177> "Bash(git push *)"

178 ],178> ],

179 // Deny reads of env files and the secrets folder by the file tools and file-reading commands179> // Deny reads of env files and the secrets folder by the file tools and file-reading commands

180 "deny": [180> "deny": [

181 "Read(./.env)",181> "Read(./.env)",

182 "Read(./.env.*)",182> "Read(./.env.*)",

183 "Read(./secrets/**)"183> "Read(./secrets/**)"

184 ]184> ]

185 },185> },

186 // Before every Bash command, run a script in the repo that can block it186> // Before every Bash command, run a script in the repo that can block it

187 "hooks": {187> "hooks": {

188 "PreToolUse": [188> "PreToolUse": [

189 {189> {

190 "matcher": "Bash",190> "matcher": "Bash",

191 "hooks": [191> "hooks": [

192 {192> {

193 "type": "command",193> "type": "command",

194 "command": "${CLAUDE_PROJECT_DIR}/.claude/hooks/block-rm.sh"194> "command": "${CLAUDE_PROJECT_DIR}/.claude/hooks/block-rm.sh"

195 }195> }

196 ]196> ]

197 }197> }

198 ]198> ]

199 },199> },

200 // Register the team's plugin marketplace on every clone200> // Register the team's plugin marketplace on every clone

201 "extraKnownMarketplaces": {201> "extraKnownMarketplaces": {

202 "acme-tools": {202> "acme-tools": {

203 "source": {203> "source": {

204 "source": "github",204> "source": "github",

205 "repo": "acme-corp/claude-plugins"205> "repo": "acme-corp/claude-plugins"

206 }206> }

207 }207> }

208 },208> },

209 // Enable one plugin from that marketplace; a plugin from an external source such as a GitHub repository still needs each person to install it once209> // Enable one plugin from that marketplace; a plugin from an external source such as a GitHub repository still needs each person to install it once

210 "enabledPlugins": {210> "enabledPlugins": {

211 "code-formatter@acme-tools": true211> "code-formatter@acme-tools": true

212 },212> },

213 // Sandbox commands: writable build dir; npm and example.com pre-allowed213> // Sandbox commands: writable build dir; npm and example.com pre-allowed

214 "sandbox": {214> "sandbox": {

215 "enabled": true,215> "enabled": true,

216 "filesystem": {216> "filesystem": {

217 "allowWrite": [217> "allowWrite": [

218 "/tmp/build"218> "/tmp/build"

219 ]219> ]

220 },220> },

221 "network": {221> "network": {

222 "allowedDomains": [222> "allowedDomains": [

223 "registry.npmjs.org",223> "registry.npmjs.org",

224 "*.example.com"224> "*.example.com"

225 ]225> ]

226 }226> }

227 },227> },

228 // Keep plan files inside the repo228> // Keep plan files inside the repo

229 "plansDirectory": "./plans"229> "plansDirectory": "./plans"

230}230> }

231```231> ```

232 232 

233## An organization's managed settings233## An organization's managed settings

234 234 


247 247 

248Administrators deploy a file like this as `managed-settings.json`, or the same JSON through MDM or [server-managed settings](https://code.claude.com/docs/en/server-managed-settings.md). One deployed file applies to every machine or account it reaches. To give a group different values, deploy a different file or profile to that group, since [server-managed settings don't support per-group policy yet](https://code.claude.com/docs/en/server-managed-settings.md#current-limitations).248Administrators deploy a file like this as `managed-settings.json`, or the same JSON through MDM or [server-managed settings](https://code.claude.com/docs/en/server-managed-settings.md). One deployed file applies to every machine or account it reaches. To give a group different values, deploy a different file or profile to that group, since [server-managed settings don't support per-group policy yet](https://code.claude.com/docs/en/server-managed-settings.md#current-limitations).

249 249 

250**Copyable settings file**250> [tab] Copyable settings file

251 251>

252Deploy this as `managed-settings.json`, or the same JSON through MDM or the claude.ai console. It's valid JSON with no comments; replace the example organization UUID, server URL, and marketplace with your own and delete the keys you don't want.252> Deploy this as `managed-settings.json`, or the same JSON through MDM or the claude.ai console. It's valid JSON with no comments; replace the example organization UUID, server URL, and marketplace with your own and delete the keys you don't want.

253 253>

254```json managed-settings.json theme={null}254> ```json managed-settings.json theme={null}

255{255> {

256 "forceLoginMethod": "claudeai",256> "forceLoginMethod": "claudeai",

257 "forceLoginOrgUUID": [257> "forceLoginOrgUUID": [

258 "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"258> "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"

259 ],259> ],

260 "availableModels": [260> "availableModels": [

261 "opus",261> "opus",

262 "sonnet"262> "sonnet"

263 ],263> ],

264 "enforceAvailableModels": true,264> "enforceAvailableModels": true,

265 "permissions": {265> "permissions": {

266 "deny": [266> "deny": [

267 "Bash(curl *)",267> "Bash(curl *)",

268 "Read(./.env)",268> "Read(./.env)",

269 "Read(./secrets/**)"269> "Read(./secrets/**)"

270 ],270> ],

271 "disableBypassPermissionsMode": "disable"271> "disableBypassPermissionsMode": "disable"

272 },272> },

273 "allowManagedPermissionRulesOnly": true,273> "allowManagedPermissionRulesOnly": true,

274 "allowedMcpServers": [274> "allowedMcpServers": [

275 {275> {

276 "serverUrl": "https://api.githubcopilot.com/*"276> "serverUrl": "https://api.githubcopilot.com/*"

277 }277> }

278 ],278> ],

279 "allowManagedMcpServersOnly": true,279> "allowManagedMcpServersOnly": true,

280 "strictKnownMarketplaces": [280> "strictKnownMarketplaces": [

281 {281> {

282 "source": "github",282> "source": "github",

283 "repo": "acme-corp/approved-plugins"283> "repo": "acme-corp/approved-plugins"

284 }284> }

285 ],285> ],

286 "sandbox": {286> "sandbox": {

287 "enabled": true,287> "enabled": true,

288 "failIfUnavailable": true,288> "failIfUnavailable": true,

289 "allowUnsandboxedCommands": false,289> "allowUnsandboxedCommands": false,

290 "network": {290> "network": {

291 "allowedDomains": [291> "allowedDomains": [

292 "registry.npmjs.org",292> "registry.npmjs.org",

293 "github.com"293> "github.com"

294 ],294> ],

295 "allowManagedDomainsOnly": true295> "allowManagedDomainsOnly": true

296 }296> }

297 },297> },

298 "requiredMinimumVersion": "2.1.150",298> "requiredMinimumVersion": "2.1.150",

299 "cleanupPeriodDays": 7,299> "cleanupPeriodDays": 7,

300 "companyAnnouncements": [300> "companyAnnouncements": [

301 "Welcome to Acme Corp! Review our code guidelines at docs.example.com"301> "Welcome to Acme Corp! Review our code guidelines at docs.example.com"

302 ]302> ]

303}303> }

304```304> ```

305 305 

306**What each key does**306> [tab] What each key does

307 307>

308The same file with a comment above each key. Read it here; copy from the other tab, because Claude Code doesn't accept comments in a settings file.308> The same file with a comment above each key. Read it here; copy from the other tab, because Claude Code doesn't accept comments in a settings file.

309 309>

310```jsonc managed-settings.json theme={null}310> ```jsonc managed-settings.json theme={null}

311{311> {

312 // Only claude.ai logins, and only in this organization312> // Only claude.ai logins, and only in this organization

313 "forceLoginMethod": "claudeai",313> "forceLoginMethod": "claudeai",

314 "forceLoginOrgUUID": [314> "forceLoginOrgUUID": [

315 "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"315> "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"

316 ],316> ],

317 // Only Opus and Sonnet models; with enforceAvailableModels, the Default option obeys the list too317> // Only Opus and Sonnet models; with enforceAvailableModels, the Default option obeys the list too

318 "availableModels": [318> "availableModels": [

319 "opus",319> "opus",

320 "sonnet"320> "sonnet"

321 ],321> ],

322 "enforceAvailableModels": true,322> "enforceAvailableModels": true,

323 "permissions": {323> "permissions": {

324 // Deny curl commands and reads of the project's .env file and secrets folder on every machine324> // Deny curl commands and reads of the project's .env file and secrets folder on every machine

325 "deny": [325> "deny": [

326 "Bash(curl *)",326> "Bash(curl *)",

327 "Read(./.env)",327> "Read(./.env)",

328 "Read(./secrets/**)"328> "Read(./secrets/**)"

329 ],329> ],

330 // Remove the bypass-permissions mode from every session330> // Remove the bypass-permissions mode from every session

331 "disableBypassPermissionsMode": "disable"331> "disableBypassPermissionsMode": "disable"

332 },332> },

333 // Ignore permission rules from user, project, and local settings333> // Ignore permission rules from user, project, and local settings

334 "allowManagedPermissionRulesOnly": true,334> "allowManagedPermissionRulesOnly": true,

335 // Only the GitHub MCP server, matched by URL rather than by name, since a user can335> // Only the GitHub MCP server, matched by URL rather than by name, since a user can

336 // name any server "github". User-added servers that don't match don't load, including336> // name any server "github". User-added servers that don't match don't load, including

337 // every stdio server when the list has only URL entries. The allowManagedMcpServersOnly337> // every stdio server when the list has only URL entries. The allowManagedMcpServersOnly

338 // key below makes this managed list the only allowlist that applies338> // key below makes this managed list the only allowlist that applies

339 "allowedMcpServers": [339> "allowedMcpServers": [

340 {340> {

341 "serverUrl": "https://api.githubcopilot.com/*"341> "serverUrl": "https://api.githubcopilot.com/*"

342 }342> }

343 ],343> ],

344 "allowManagedMcpServersOnly": true,344> "allowManagedMcpServersOnly": true,

345 // Plugins can come only from this marketplace345> // Plugins can come only from this marketplace

346 "strictKnownMarketplaces": [346> "strictKnownMarketplaces": [

347 {347> {

348 "source": "github",348> "source": "github",

349 "repo": "acme-corp/approved-plugins"349> "repo": "acme-corp/approved-plugins"

350 }350> }

351 ],351> ],

352 // Sandbox every command Claude runs, refuse to start if the sandbox can't be352> // Sandbox every command Claude runs, refuse to start if the sandbox can't be

353 // set up, and never let a blocked command retry outside the sandbox; network353> // set up, and never let a blocked command retry outside the sandbox; network

354 // limited to npm and GitHub, and users can't add domains354> // limited to npm and GitHub, and users can't add domains

355 "sandbox": {355> "sandbox": {

356 "enabled": true,356> "enabled": true,

357 "failIfUnavailable": true,357> "failIfUnavailable": true,

358 "allowUnsandboxedCommands": false,358> "allowUnsandboxedCommands": false,

359 "network": {359> "network": {

360 "allowedDomains": [360> "allowedDomains": [

361 "registry.npmjs.org",361> "registry.npmjs.org",

362 "github.com"362> "github.com"

363 ],363> ],

364 "allowManagedDomainsOnly": true364> "allowManagedDomainsOnly": true

365 }365> }

366 },366> },

367 // Refuse to start on versions older than 2.1.150367> // Refuse to start on versions older than 2.1.150

368 "requiredMinimumVersion": "2.1.150",368> "requiredMinimumVersion": "2.1.150",

369 // Delete session transcripts and other local session data after 7 days369> // Delete session transcripts and other local session data after 7 days

370 "cleanupPeriodDays": 7,370> "cleanupPeriodDays": 7,

371 // A message every user sees at startup371> // A message every user sees at startup

372 "companyAnnouncements": [372> "companyAnnouncements": [

373 "Welcome to Acme Corp! Review our code guidelines at docs.example.com"373> "Welcome to Acme Corp! Review our code guidelines at docs.example.com"

374 ]374> ]

375}375> }

376```376> ```

Details

3865* **Type**: Boolean3865* **Type**: Boolean

3866 * `true`: Claude Code allows channels for your organization3866 * `true`: Claude Code allows channels for your organization

3867 * `false`: the same as unset; whether channels are blocked depends on your plan, as the Default says3867 * `false`: the same as unset; whether channels are blocked depends on your plan, as the Default says

3868* **Default**: unset; channels are blocked on Team and Enterprise plans and on Console accounts with managed settings, and allowed on Pro and Max plans and on Console accounts without managed settings3868* **Default**: unset; channels are blocked on Team and Enterprise plans and on Console accounts with managed settings, and allowed on Pro, Max, and Ultra plans and on Console accounts without managed settings

3869 3869 

3870```json managed-settings.json theme={null}3870```json managed-settings.json theme={null}

3871{3871{

setup.md +251 −251

Details

35 35 

36To install Claude Code, open a terminal and run the command for your system. If you haven't used a terminal before, the [terminal guide](https://code.claude.com/docs/en/terminal-guide) shows how to open one and paste the command.36To install Claude Code, open a terminal and run the command for your system. If you haven't used a terminal before, the [terminal guide](https://code.claude.com/docs/en/terminal-guide) shows how to open one and paste the command.

37 37 

38**Native Install (Recommended)**38> [tab] Native Install (Recommended)

39 

40**macOS, Linux, WSL:**

41 

42```bash theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null}

43curl -fsSL https://claude.ai/install.sh | bash

44```

45 

46On Windows, your prompt shows `PS C:\` when you're in PowerShell and `C:\` without the `PS` when you're in CMD.

47 

48**Windows PowerShell:**

49 

50```powershell theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null}

51irm https://claude.ai/install.ps1 | iex

52```

53 

54**Windows CMD:**

55 

56```batch theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null}

57curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd

58```

59 

60The install command shows no progress while it downloads Claude Code. When the installer finishes, open a new terminal window and run `claude --version`. A working installation prints a version number. If your shell says `claude` isn't found or isn't recognized, the install directory isn't on your PATH yet: see [Fix your PATH](https://code.claude.com/docs/en/troubleshoot-install.md#command-not-found-claude-after-installation).

61 

62If you see `The token '&&' is not a valid statement separator`, you're in PowerShell, not CMD. If you see `'irm' is not recognized as an internal or external command`, you're in CMD, not PowerShell.

63 

64If the install command fails with `syntax error near unexpected token '<'`, a `403`, or any other error, see [Troubleshoot installation](https://code.claude.com/docs/en/troubleshoot-install.md#find-your-error) to match the error to a fix and for alternative install methods.

65 

66[Git for Windows](https://git-scm.com/downloads/win) is recommended on native Windows so Claude Code can use the Bash tool. If Git for Windows is not installed, Claude Code uses PowerShell as the shell tool instead. WSL setups do not need Git for Windows.

67 

68> [!NOTE]

69>39>

70> Native installations automatically update in the background to keep you on the latest version.40> **macOS, Linux, WSL:**

71 

72**Homebrew**

73 

74```bash theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null}

75brew install --cask claude-code

76```

77 

78Homebrew offers two casks. `claude-code` tracks the stable release channel, which is typically about a week behind and skips releases with major regressions. `claude-code@latest` tracks the latest channel and receives new versions as soon as they ship.

79 

80> [!NOTE]

81>41>

82> Homebrew installations do not auto-update. Run `brew upgrade claude-code` or `brew upgrade claude-code@latest`, depending on which cask you installed, to get the latest features and security fixes.42> ```bash theme={null}

83 43> curl -fsSL https://claude.ai/install.sh | bash

84**WinGet**44> ```

45>

46> On Windows, your prompt shows `PS C:\` when you're in PowerShell and `C:\` without the `PS` when you're in CMD.

47>

48> **Windows PowerShell:**

49>

50> ```powershell theme={null}

51> irm https://claude.ai/install.ps1 | iex

52> ```

53>

54> **Windows CMD:**

55>

56> ```batch theme={null}

57> curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd

58> ```

59>

60> The install command shows no progress while it downloads Claude Code. When the installer finishes, open a new terminal window and run `claude --version`. A working installation prints a version number. If your shell says `claude` isn't found or isn't recognized, the install directory isn't on your PATH yet: see [Fix your PATH](https://code.claude.com/docs/en/troubleshoot-install.md#command-not-found-claude-after-installation).

61>

62> If you see `The token '&&' is not a valid statement separator`, you're in PowerShell, not CMD. If you see `'irm' is not recognized as an internal or external command`, you're in CMD, not PowerShell.

63>

64> If the install command fails with `syntax error near unexpected token '<'`, a `403`, or any other error, see [Troubleshoot installation](https://code.claude.com/docs/en/troubleshoot-install.md#find-your-error) to match the error to a fix and for alternative install methods.

65>

66> [Git for Windows](https://git-scm.com/downloads/win) is recommended on native Windows so Claude Code can use the Bash tool. If Git for Windows is not installed, Claude Code uses PowerShell as the shell tool instead. WSL setups do not need Git for Windows.

67>

68> > [!NOTE]

69> >

70> > Native installations automatically update in the background to keep you on the latest version.

85 71 

86```powershell theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null} theme={null}72> [tab] Homebrew

87winget install Anthropic.ClaudeCode73>

88```74> ```bash theme={null}

75> brew install --cask claude-code

76> ```

77>

78> Homebrew offers two casks. `claude-code` tracks the stable release channel, which is typically about a week behind and skips releases with major regressions. `claude-code@latest` tracks the latest channel and receives new versions as soon as they ship.

79>

80> > [!NOTE]

81> >

82> > Homebrew installations do not auto-update. Run `brew upgrade claude-code` or `brew upgrade claude-code@latest`, depending on which cask you installed, to get the latest features and security fixes.

89 83 

90> [!NOTE]84> [tab] WinGet

85>

86> ```powershell theme={null}

87> winget install Anthropic.ClaudeCode

88> ```

91>89>

92> WinGet installations do not auto-update. Run `winget upgrade Anthropic.ClaudeCode` periodically to get the latest features and security fixes.90> > [!NOTE]

91> >

92> > WinGet installations do not auto-update. Run `winget upgrade Anthropic.ClaudeCode` periodically to get the latest features and security fixes.

93 93 

94You can also install with [apt, dnf, or apk](https://code.claude.com/docs/en/setup.md#install-with-linux-package-managers) on Debian, Fedora, RHEL, and Alpine.94You can also install with [apt, dnf, or apk](https://code.claude.com/docs/en/setup.md#install-with-linux-package-managers) on Debian, Fedora, RHEL, and Alpine.

95 95 


188 188 

189## Authenticate189## Authenticate

190 190 

191Claude Code requires a Pro, Max, Team, Enterprise, or Console account. The free claude.ai plan does not include Claude Code access. You can also use Claude Code with a third-party API provider like [Amazon Bedrock](https://code.claude.com/docs/en/amazon-bedrock.md), [Google Cloud's Agent Platform](https://code.claude.com/docs/en/google-vertex-ai.md), or [Microsoft Foundry](https://code.claude.com/docs/en/microsoft-foundry.md).191Claude Code requires a Pro, Max, Ultra, Team, Enterprise, or Console account. The free claude.ai plan does not include Claude Code access. You can also use Claude Code with a third-party API provider like [Amazon Bedrock](https://code.claude.com/docs/en/amazon-bedrock.md), [Google Cloud's Agent Platform](https://code.claude.com/docs/en/google-vertex-ai.md), or [Microsoft Foundry](https://code.claude.com/docs/en/microsoft-foundry.md).

192 192 

193After installing, log in by running `claude` and following the browser prompts. If you've set the `ANTHROPIC_API_KEY` environment variable and you approve the key when Claude Code asks whether to use it, Claude Code skips the login prompt. See [Authentication](https://code.claude.com/docs/en/authentication.md) for all account types and team setup options.193After installing, log in by running `claude` and following the browser prompts. If you've set the `ANTHROPIC_API_KEY` environment variable and you approve the key when Claude Code asks whether to use it, Claude Code skips the login prompt. See [Authentication](https://code.claude.com/docs/en/authentication.md) for all account types and team setup options.

194 194 


300 300 

301To install the latest version (default):301To install the latest version (default):

302 302 

303**macOS, Linux, WSL**303> [tab] macOS, Linux, WSL

304 304>

305```bash theme={null}305> ```bash theme={null}

306curl -fsSL https://claude.ai/install.sh | bash306> curl -fsSL https://claude.ai/install.sh | bash

307```307> ```

308 

309**Windows PowerShell**

310 

311```powershell theme={null}

312irm https://claude.ai/install.ps1 | iex

313```

314 308 

315**Windows CMD**309> [tab] Windows PowerShell

310>

311> ```powershell theme={null}

312> irm https://claude.ai/install.ps1 | iex

313> ```

316 314 

317```batch theme={null}315> [tab] Windows CMD

318curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd316>

319```317> ```batch theme={null}

318> curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd

319> ```

320 320 

321To install the stable version:321To install the stable version:

322 322 

323**macOS, Linux, WSL**323> [tab] macOS, Linux, WSL

324 324>

325```bash theme={null}325> ```bash theme={null}

326curl -fsSL https://claude.ai/install.sh | bash -s stable326> curl -fsSL https://claude.ai/install.sh | bash -s stable

327```327> ```

328 

329**Windows PowerShell**

330 

331```powershell theme={null}

332& ([scriptblock]::Create((irm https://claude.ai/install.ps1))) stable

333```

334 328 

335**Windows CMD**329> [tab] Windows PowerShell

330>

331> ```powershell theme={null}

332> & ([scriptblock]::Create((irm https://claude.ai/install.ps1))) stable

333> ```

336 334 

337```batch theme={null}335> [tab] Windows CMD

338curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd stable && del install.cmd336>

339```337> ```batch theme={null}

338> curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd stable && del install.cmd

339> ```

340 340 

341To install a specific version number:341To install a specific version number:

342 342 

343**macOS, Linux, WSL**343> [tab] macOS, Linux, WSL

344 344>

345```bash theme={null}345> ```bash theme={null}

346curl -fsSL https://claude.ai/install.sh | bash -s 2.1.89346> curl -fsSL https://claude.ai/install.sh | bash -s 2.1.89

347```347> ```

348 

349**Windows PowerShell**

350 

351```powershell theme={null}

352& ([scriptblock]::Create((irm https://claude.ai/install.ps1))) 2.1.89

353```

354 348 

355**Windows CMD**349> [tab] Windows PowerShell

350>

351> ```powershell theme={null}

352> & ([scriptblock]::Create((irm https://claude.ai/install.ps1))) 2.1.89

353> ```

356 354 

357```batch theme={null}355> [tab] Windows CMD

358curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd 2.1.89 && del install.cmd356>

359```357> ```batch theme={null}

358> curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd 2.1.89 && del install.cmd

359> ```

360 360 

361To confirm which version installed, run `claude --version`: the command prints the exact version you passed, such as `2.1.89 (Claude Code)`.361To confirm which version installed, run `claude --version`: the command prints the exact version you passed, such as `2.1.89 (Claude Code)`.

362 362 


366 366 

367All 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.367All 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.

368 368 

369**apt**369> [tab] apt

370 370>

371For Debian and Ubuntu. The install commands below download the signing key with `curl` and verify it with `gpg`, which fresh Debian and Ubuntu installations may not include. If either command reports `command not found`, install both first:371> For Debian and Ubuntu. The install commands below download the signing key with `curl` and verify it with `gpg`, which fresh Debian and Ubuntu installations may not include. If either command reports `command not found`, install both first:

372 372>

373```bash theme={null}373> ```bash theme={null}

374sudo apt install curl gnupg374> sudo apt install curl gnupg

375```375> ```

376 376>

377Download the signing key:377> Download the signing key:

378 378>

379```bash theme={null}379> ```bash theme={null}

380sudo install -d -m 0755 /etc/apt/keyrings380> sudo install -d -m 0755 /etc/apt/keyrings

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

382 -o /etc/apt/keyrings/claude-code.asc382> -o /etc/apt/keyrings/claude-code.asc

383```383> ```

384 384>

385If this download fails, `apt update` later fails with `NO_PUBKEY BAA929FF1A7ECACE`. Confirm the key downloaded and belongs to Anthropic before continuing:385> If this download fails, `apt update` later fails with `NO_PUBKEY BAA929FF1A7ECACE`. Confirm the key downloaded and belongs to Anthropic before continuing:

386 386>

387```bash theme={null}387> ```bash theme={null}

388gpg --show-keys /etc/apt/keyrings/claude-code.asc388> gpg --show-keys /etc/apt/keyrings/claude-code.asc

389```389> ```

390 390>

391The fingerprint gpg prints should be `31DDDE24DDFAB679F42D7BD2BAA929FF1A7ECACE`. If gpg reports that the file can't be opened or contains no valid OpenPGP data, the download failed or returned the wrong content: confirm your network can reach `downloads.claude.ai`, then rerun the download command.391> The fingerprint gpg prints should be `31DDDE24DDFAB679F42D7BD2BAA929FF1A7ECACE`. If gpg reports that the file can't be opened or contains no valid OpenPGP data, the download failed or returned the wrong content: confirm your network can reach `downloads.claude.ai`, then rerun the download command.

392 392>

393Register the repository on the `stable` channel and install:393> Register the repository on the `stable` channel and install:

394 394>

395```bash theme={null}395> ```bash theme={null}

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

397 | sudo tee /etc/apt/sources.list.d/claude-code.list397> | sudo tee /etc/apt/sources.list.d/claude-code.list

398sudo apt update398> sudo apt update

399sudo apt install claude-code399> sudo apt install claude-code

400```400> ```

401 401>

402To use the `latest` channel instead, both the URL path and the suite name change. Use this `deb` line:402> To use the `latest` channel instead, both the URL path and the suite name change. Use this `deb` line:

403 403>

404```bash theme={null}404> ```bash theme={null}

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

406 | sudo tee /etc/apt/sources.list.d/claude-code.list406> | sudo tee /etc/apt/sources.list.d/claude-code.list

407```407> ```

408 408>

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

410 

411**dnf**

412 

413For Fedora and RHEL. The following commands configure the `stable` channel:

414 

415```bash theme={null}

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

417[claude-code]

418name=Claude Code

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

420enabled=1

421gpgcheck=1

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

423EOF

424sudo dnf install claude-code

425```

426 

427To use the `latest` channel instead, set `baseurl` to the `latest` repository:

428 

429```ini theme={null}

430baseurl=https://downloads.claude.ai/claude-code/rpm/latest

431```

432 

433dnf 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.

434 

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

436 

437**apk**

438 

439For Alpine Linux. The following commands configure the `stable` channel:

440 

441```sh theme={null}

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

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

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

445apk add claude-code

446```

447 

448To switch to the `latest` channel, remove the `stable` repository line and add the `latest` repository:

449 

450```sh theme={null}

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

452echo "https://downloads.claude.ai/claude-code/apk/latest" >> /etc/apk/repositories

453```

454 410 

455Verify the downloaded key with `sha256sum /etc/apk/keys/claude-code.rsa.pub`, which should report `395759c1f7449ef4cdef305a42e820f3c766d6090d142634ebdb049f113168b6`.411> [tab] dnf

412>

413> For Fedora and RHEL. The following commands configure the `stable` channel:

414>

415> ```bash theme={null}

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

417> [claude-code]

418> name=Claude Code

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

420> enabled=1

421> gpgcheck=1

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

423> EOF

424> sudo dnf install claude-code

425> ```

426>

427> To use the `latest` channel instead, set `baseurl` to the `latest` repository:

428>

429> ```ini theme={null}

430> baseurl=https://downloads.claude.ai/claude-code/rpm/latest

431> ```

432>

433> 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.

434>

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

456 436 

457To upgrade later, run `apk update && apk upgrade claude-code`.437> [tab] apk

438>

439> For Alpine Linux. The following commands configure the `stable` channel:

440>

441> ```sh theme={null}

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

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

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

445> apk add claude-code

446> ```

447>

448> To switch to the `latest` channel, remove the `stable` repository line and add the `latest` repository:

449>

450> ```sh theme={null}

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

452> echo "https://downloads.claude.ai/claude-code/apk/latest" >> /etc/apk/repositories

453> ```

454>

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

456>

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

458 458 

459### Install with npm459### Install with npm

460 460 


546 546 

547Compare the SHA256 checksum of the binary with the value listed under `platforms.<platform>.checksum` in `manifest.json`. The commands below assume a `claude` binary in the current directory. To verify an installed native binary instead, run the command against `~/.local/share/claude/versions/VERSION`, replacing VERSION with the release you set in Step 2.547Compare the SHA256 checksum of the binary with the value listed under `platforms.<platform>.checksum` in `manifest.json`. The commands below assume a `claude` binary in the current directory. To verify an installed native binary instead, run the command against `~/.local/share/claude/versions/VERSION`, replacing VERSION with the release you set in Step 2.

548 548 

549**Linux**549> [tab] Linux

550 550>

551```bash theme={null}551> ```bash theme={null}

552sha256sum claude552> sha256sum claude

553```553> ```

554 

555**macOS**

556 

557```bash theme={null}

558shasum -a 256 claude

559```

560 554 

561**Windows PowerShell**555> [tab] macOS

556>

557> ```bash theme={null}

558> shasum -a 256 claude

559> ```

562 560 

563```powershell theme={null}561> [tab] Windows PowerShell

564(Get-FileHash claude.exe -Algorithm SHA256).Hash.ToLower()562>

565```563> ```powershell theme={null}

564> (Get-FileHash claude.exe -Algorithm SHA256).Hash.ToLower()

565> ```

566 566 

567> [!NOTE]567> [!NOTE]

568>568>


584 584 

585Remove the Claude Code binary and version files:585Remove the Claude Code binary and version files:

586 586 

587**macOS, Linux, WSL**587> [tab] macOS, Linux, WSL

588 588>

589```bash theme={null}589> ```bash theme={null}

590rm -f ~/.local/bin/claude590> rm -f ~/.local/bin/claude

591rm -rf ~/.local/share/claude591> rm -rf ~/.local/share/claude

592```592> ```

593 

594**Windows PowerShell**

595 593 

596```powershell theme={null}594> [tab] Windows PowerShell

597Remove-Item -Path "$env:USERPROFILE\.local\bin\claude.exe" -Force595>

598Remove-Item -Path "$env:USERPROFILE\.local\share\claude" -Recurse -Force596> ```powershell theme={null}

599```597> Remove-Item -Path "$env:USERPROFILE\.local\bin\claude.exe" -Force

598> Remove-Item -Path "$env:USERPROFILE\.local\share\claude" -Recurse -Force

599> ```

600 600 

601### Uninstall with Homebrew601### Uninstall with Homebrew

602 602 


624 624 

625Remove the package and the repository configuration:625Remove the package and the repository configuration:

626 626 

627**apt**627> [tab] apt

628 628>

629```bash theme={null}629> ```bash theme={null}

630sudo apt remove claude-code630> sudo apt remove claude-code

631sudo rm /etc/apt/sources.list.d/claude-code.list /etc/apt/keyrings/claude-code.asc631> sudo rm /etc/apt/sources.list.d/claude-code.list /etc/apt/keyrings/claude-code.asc

632```632> ```

633 

634**dnf**

635 

636```bash theme={null}

637sudo dnf remove claude-code

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

639```

640 633 

641**apk**634> [tab] dnf

635>

636> ```bash theme={null}

637> sudo dnf remove claude-code

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

639> ```

642 640 

643```sh theme={null}641> [tab] apk

644apk del claude-code642>

645sed -i '\|downloads.claude.ai/claude-code/apk|d' /etc/apk/repositories643> ```sh theme={null}

646rm /etc/apk/keys/claude-code.rsa.pub644> apk del claude-code

647```645> sed -i '\|downloads.claude.ai/claude-code/apk|d' /etc/apk/repositories

646> rm /etc/apk/keys/claude-code.rsa.pub

647> ```

648 648 

649### Uninstall with npm649### Uninstall with npm

650 650 


664 664 

665To remove Claude Code settings and cached data:665To remove Claude Code settings and cached data:

666 666 

667**macOS, Linux, WSL**667> [tab] macOS, Linux, WSL

668 668>

669```bash theme={null}669> ```bash theme={null}

670# Remove user settings and state670> # Remove user settings and state

671rm -rf ~/.claude671> rm -rf ~/.claude

672rm ~/.claude.json672> rm ~/.claude.json

673 673>

674# Remove project-specific settings (run from your project directory)674> # Remove project-specific settings (run from your project directory)

675rm -rf .claude675> rm -rf .claude

676rm -f .mcp.json676> rm -f .mcp.json

677```677> ```

678 

679**Windows PowerShell**

680 

681```powershell theme={null}

682# Remove user settings and state

683Remove-Item -Path "$env:USERPROFILE\.claude" -Recurse -Force

684Remove-Item -Path "$env:USERPROFILE\.claude.json" -Force

685 678 

686# Remove project-specific settings (run from your project directory)679> [tab] Windows PowerShell

687Remove-Item -Path ".claude" -Recurse -Force680>

688Remove-Item -Path ".mcp.json" -Force681> ```powershell theme={null}

689```682> # Remove user settings and state

683> Remove-Item -Path "$env:USERPROFILE\.claude" -Recurse -Force

684> Remove-Item -Path "$env:USERPROFILE\.claude.json" -Force

685>

686> # Remove project-specific settings (run from your project directory)

687> Remove-Item -Path ".claude" -Recurse -Force

688> Remove-Item -Path ".mcp.json" -Force

689> ```

skills.md +1 −1

Details

42* **Extensions**: unused skills, MCP servers, and plugins compared with their context cost, and slow [hooks](https://code.claude.com/docs/en/hooks.md)42* **Extensions**: unused skills, MCP servers, and plugins compared with their context cost, and slow [hooks](https://code.claude.com/docs/en/hooks.md)

43* **`CLAUDE.md` files**: local `CLAUDE.md` files that duplicate checked-in ones, checked-in [`CLAUDE.md` content Claude could derive from the codebase](https://code.claude.com/docs/en/memory#my-claude-md-is-too-large), and the always-loaded guidance that remains, which Claude offers to migrate into skills and nested `CLAUDE.md` files that load on demand43* **`CLAUDE.md` files**: local `CLAUDE.md` files that duplicate checked-in ones, checked-in [`CLAUDE.md` content Claude could derive from the codebase](https://code.claude.com/docs/en/memory#my-claude-md-is-too-large), and the always-loaded guidance that remains, which Claude offers to migrate into skills and nested `CLAUDE.md` files that load on demand

44* **Permissions**: an offer to make [auto mode](https://code.claude.com/docs/en/permissions.md#permission-modes) your default permission mode and to [pre-approve](https://code.claude.com/docs/en/permissions.md) read-only commands that you frequently deny44* **Permissions**: an offer to make [auto mode](https://code.claude.com/docs/en/permissions.md#permission-modes) your default permission mode and to [pre-approve](https://code.claude.com/docs/en/permissions.md) read-only commands that you frequently deny

45* **Usage**: on a Pro, Max, Team, or Enterprise plan, the [changes `/usage` recommends](https://code.claude.com/docs/en/costs#plan-usage-breakdown) to lower your plan usage, measured over the last 7 days. Claude proposes the changes it can make itself and reports the rest as advice, such as a command for you to run. The usage check requires Claude Code v2.1.305 or later, and `/doctor` leaves it out while [Remote Control](https://code.claude.com/docs/en/remote-control.md) is connected.45* **Usage**: on a Pro, Max, Ultra, Team, or Enterprise plan, the [changes `/usage` recommends](https://code.claude.com/docs/en/costs#plan-usage-breakdown) to lower your plan usage, measured over the last 7 days. Claude proposes the changes it can make itself and reports the rest as advice, such as a command for you to run. The usage check requires Claude Code v2.1.305 or later, and `/doctor` leaves it out while [Remote Control](https://code.claude.com/docs/en/remote-control.md) is connected.

46 46 

47For read-only installation diagnostics without starting a session, run `claude doctor` in your terminal instead.47For read-only installation diagnostics without starting a session, run `claude doctor` in your terminal instead.

48 48 

slack.md +11 −11

Details

4 4 

5# Claude Code in Slack5# Claude Code in Slack

6 6 

7> Delegate coding tasks from Slack. This earlier version answers channel mentions only from Pro and Max accounts in workspaces not connected to Claude Tag.7> Delegate coding tasks from Slack. This earlier version answers mentions only from Pro, Max, and Ultra accounts in workspaces not connected to Claude Tag.

8 8 

9> [!WARNING]9> [!WARNING]

10>10>

11> This page documents the earlier Claude Code in Slack, which runs each session under an individual user's account. It answers channel @mentions only from Pro and Max accounts, and only in a Slack workspace that no organization has connected to [Claude Tag](https://claude.com/product/tag). Claude Tag runs @Claude as your organization's shared identity with admin-configured access.11> This earlier Claude Code in Slack answers channel @mentions only from Pro, Max, and Ultra accounts, and only in a Slack workspace that no organization has connected to [Claude Tag](https://claude.com/product/tag). Each session runs under an individual user's account. Claude Tag runs @Claude as your organization's shared identity with admin-configured access.

12>12>

13> * **Pro and Max plans:** Claude Tag isn't available on individual plans, so this page remains the setup path in a workspace that isn't connected to Claude Tag.13> * **Pro, Max, and Ultra plans:** Claude Tag isn't available on individual plans, so [set up this version](#setting-up-claude-code-in-slack) in a workspace that isn't connected to Claude Tag.

14> * **Team and Enterprise plans:** your existing Slack app and @Claude handle stay. [Set up Claude Tag](https://claude.com/docs/claude-tag/overview) for a new workspace; to move one that already uses this version, see [Migrate from the earlier Claude in Slack](https://claude.com/docs/claude-tag/admins/migrate-from-earlier).14> * **Team and Enterprise plans:** your existing Slack app and @Claude handle stay. [Set up Claude Tag](https://claude.com/docs/claude-tag/overview) for a new workspace; to move one that already uses this version, see [Migrate from the earlier Claude in Slack](https://claude.com/docs/claude-tag/admins/migrate-from-earlier).

15> * **Notice instead of an answer:** look up the [setup notice](#this-workspace-isnt-set-up-for-claude-tag-yet) or the [retirement notice](#the-legacy-claude-in-slack-bot-is-retired) that @Claude replied with.15> * **Notice instead of an answer:** look up the [setup notice](#this-workspace-isnt-set-up-for-claude-tag-yet) or the [retirement notice](#the-legacy-claude-in-slack-bot-is-retired) that @Claude replied with.

16 16 


31 31 

32| Requirement | Details |32| Requirement | Details |

33| :- | :- |33| :- | :- |

34| Claude Plan | Pro or Max |34| Claude Plan | Pro, Max, or Ultra |

35| Slack workspace | Not connected to [Claude Tag](https://claude.com/docs/claude-tag/overview) by any organization. If @Claude replies with the [retirement notice](#the-legacy-claude-in-slack-bot-is-retired), the workspace is connected |35| Slack workspace | Not connected to [Claude Tag](https://claude.com/docs/claude-tag/overview) by any organization. If @Claude replies with the [retirement notice](#the-legacy-claude-in-slack-bot-is-retired), the workspace is connected |

36| Cloud sessions | [Cloud sessions](https://code.claude.com/docs/en/claude-code-on-the-web.md) are enabled for your account |36| Cloud sessions | [Cloud sessions](https://code.claude.com/docs/en/claude-code-on-the-web.md) are enabled for your account |

37| GitHub Account | Connected at [claude.ai/code](https://claude.ai/code) with at least one repository authenticated |37| GitHub Account | Connected at [claude.ai/code](https://claude.ai/code) with at least one repository authenticated |


180@Claude replies in the thread with this notice instead of an answer when both of these are true:180@Claude replies in the thread with this notice instead of an answer when both of these are true:

181 181 

182* No organization has connected your Slack workspace to [Claude Tag](https://claude.com/docs/claude-tag/overview).182* No organization has connected your Slack workspace to [Claude Tag](https://claude.com/docs/claude-tag/overview).

183* The Claude account you linked in Slack isn't on a Pro or Max plan.183* The Claude account you linked in Slack isn't on a Pro, Max, or Ultra plan.

184 184 

185Claude Tag is available on Team and Enterprise plans. To connect the workspace, start with the `@Claude connect` command the notice names, then follow [Set up Claude Tag](https://claude.com/docs/claude-tag/overview).185Claude Tag is available on Team and Enterprise plans. To connect the workspace, start with the `@Claude connect` command the notice names, then follow [Set up Claude Tag](https://claude.com/docs/claude-tag/overview).

186 186 

187### "The legacy Claude in Slack bot is retired"187### "The legacy Claude in Slack bot is retired"

188 188 

189The notice opens with `The legacy Claude in Slack bot is retired effective October 5, 2026 and no longer responds in channels.` Your Slack workspace is connected to a Claude organization, and the earlier version is still selected for the channel, the workspace, or the organization default in that organization's Claude Tag settings. The notice doesn't depend on your own plan, so Pro and Max accounts get it too.189The notice opens with `The legacy Claude in Slack bot is retired effective October 5, 2026 and no longer responds in channels.` Your Slack workspace is connected to a Claude organization. The earlier version is still selected for the channel, the workspace, or the organization default in that organization's Claude Tag settings. The notice doesn't depend on your own plan, so Pro, Max, and Ultra accounts get it too.

190 190 

191If you're an Owner of that organization, open [Claude admin settings](https://claude.ai/admin-settings/claude-tag) and turn on Claude Tag for the channel. To fix every channel that inherits the setting, change it on the workspace or the organization default instead. For the full move, see [Migrate from the earlier Claude in Slack](https://claude.com/docs/claude-tag/admins/migrate-from-earlier). If you're not an Owner, send this entry to one.191If you're an Owner of that organization, open [Claude admin settings](https://claude.ai/admin-settings/claude-tag) and turn on Claude Tag for the channel. To fix every channel that inherits the setting, change it on the workspace or the organization default instead. For the full move, see [Migrate from the earlier Claude in Slack](https://claude.com/docs/claude-tag/admins/migrate-from-earlier). If you're not an Owner, send this entry to one.

192 192 


237 237 

238## Related resources238## Related resources

239 239 

240> **[Claude Code in the cloud](https://code.claude.com/docs/en/claude-code-on-the-web.md)**240> [card] [Claude Code in the cloud](https://code.claude.com/docs/en/claude-code-on-the-web.md)

241>241>

242> Learn more about cloud sessions242> Learn more about cloud sessions

243 243 

244> **[Claude for Slack](https://claude.com/claude-and-slack)**244> [card] [Claude for Slack](https://claude.com/claude-and-slack)

245>245>

246> General Claude for Slack documentation246> General Claude for Slack documentation

247 247 

248> **[Claude Tag](https://claude.com/docs/claude-tag/overview)**248> [card] [Claude Tag](https://claude.com/docs/claude-tag/overview)

249>249>

250> Organization-managed @Claude in Slack with admin-configured access250> Organization-managed @Claude in Slack with admin-configured access

251 251 

252> **[Slack App Marketplace](https://slack.com/marketplace/A08SF47R6P4)**252> [card] [Slack App Marketplace](https://slack.com/marketplace/A08SF47R6P4)

253>253>

254> Install the Claude app from the Slack Marketplace254> Install the Claude app from the Slack Marketplace

255 255 

256> **[Claude Help Center](https://support.claude.com)**256> [card] [Claude Help Center](https://support.claude.com)

257>257>

258> Get additional support258> Get additional support

statusline.md +4 −4

Details

212| `worktree.original_cwd` | The directory Claude was in before entering the worktree |212| `worktree.original_cwd` | The directory Claude was in before entering the worktree |

213| `worktree.original_branch` | Git branch checked out before entering the worktree. Absent for hook-based worktrees |213| `worktree.original_branch` | Git branch checked out before entering the worktree. Absent for hook-based worktrees |

214 214 

215> **Full JSON schema**215> [accordion] Full JSON schema

216>216>

217> Your status line command receives this JSON structure via stdin:217> Your status line command receives this JSON structure via stdin:

218>218>


341> * `agent`: appears only when running with the `--agent` flag or agent settings configured341> * `agent`: appears only when running with the `--agent` flag or agent settings configured

342> * `pr`: appears only while an open PR or GitLab merge request is found for the current branch, and is removed once it merges or closes. `pr.review_state` and `pr.kind` may be independently absent342> * `pr`: appears only while an open PR or GitLab merge request is found for the current branch, and is removed once it merges or closes. `pr.review_state` and `pr.kind` may be independently absent

343> * `worktree`: appears only while the session is in a [worktree session](https://code.claude.com/docs/en/worktrees.md). When present, `branch` and `original_branch` may also be absent for hook-based worktrees343> * `worktree`: appears only while the session is in a [worktree session](https://code.claude.com/docs/en/worktrees.md). When present, `branch` and `original_branch` may also be absent for hook-based worktrees

344> * `rate_limits`: appears only for claude.ai Pro and Max subscribers, or behind a Claude apps gateway that sets a spend limit for you, and only after the first API response in the session. Each window (`five_hour`, `seven_day`, `spend_limit`) may be independently absent, and Claude Code drops a window once its `resets_at` time passes. Use `jq -r '.rate_limits.five_hour.used_percentage // empty'` to handle absence gracefully.344> * `rate_limits`: appears only for claude.ai Pro, Max, and Ultra subscribers, or behind a Claude apps gateway that sets a spend limit for you. Even then, it appears only after the first API response in the session. Each window (`five_hour`, `seven_day`, `spend_limit`) may be independently absent, and Claude Code drops a window once its `resets_at` time passes. Use `jq -r '.rate_limits.five_hour.used_percentage // empty'` to handle absence gracefully.

345> * `prompt_cache`: appears after the main conversation's first API response. See [prompt cache fields](#prompt-cache-fields)345> * `prompt_cache`: appears after the main conversation's first API response. See [prompt cache fields](#prompt-cache-fields)

346>346>

347> **Fields that may be `null`**:347> **Fields that may be `null`**:


819 819 

820### Rate limit usage820### Rate limit usage

821 821 

822Display claude.ai subscription rate limit usage, or your spend against a Claude apps gateway spend limit, in the status line. For subscribers, the `rate_limits` object contains a rolling `five_hour` window and a weekly `seven_day` window. Each window provides `used_percentage`, from 0 to 100, and `resets_at`, the Unix epoch seconds when the window resets. Behind a gateway, read the `spend_limit` object, described under [spend limit fields](#spend-limit-fields).822Display claude.ai subscription rate limit usage, or your spend against a Claude apps gateway spend limit, in the status line. For subscribers, the `rate_limits` object can contain a rolling `five_hour` window and a weekly `seven_day` window. Each window provides `used_percentage`, from 0 to 100, and `resets_at`, the Unix epoch seconds when the window resets. Behind a gateway, read the `spend_limit` object, described under [spend limit fields](#spend-limit-fields).

823 823 

824The `rate_limits` object is only present for claude.ai Pro and Max subscribers, or behind a Claude apps gateway with spend limits, and only after the first API response. Each script handles the absent fields gracefully, and behind a gateway prints `spend: $314.12 / $500`, or `spend: 63%` while the dollar fields are absent:824The `rate_limits` object is only present for claude.ai Pro, Max, and Ultra subscribers, or behind a Claude apps gateway with spend limits, and only after the first API response. Each script handles the absent fields gracefully, and behind a gateway prints `spend: $314.12 / $500`, or `spend: 63%` while the dollar fields are absent:

825 825 

826```bash Bash theme={null}826```bash Bash theme={null}

827#!/bin/bash827#!/bin/bash

sub-agents.md +77 −77

Details

32 32 

33Explore and Plan start without your CLAUDE.md files and the git status snapshot to keep research fast and inexpensive. Other built-in and [custom subagents](#configure-subagents) load both, unless you set [`omitClaudeMd`](#supported-frontmatter-fields) in a custom subagent's definition to start it without the user, project, and local CLAUDE.md files. For the full breakdown of what reaches a subagent, see [what loads at startup](#what-loads-at-startup).33Explore and Plan start without your CLAUDE.md files and the git status snapshot to keep research fast and inexpensive. Other built-in and [custom subagents](#configure-subagents) load both, unless you set [`omitClaudeMd`](#supported-frontmatter-fields) in a custom subagent's definition to start it without the user, project, and local CLAUDE.md files. For the full breakdown of what reaches a subagent, see [what loads at startup](#what-loads-at-startup).

34 34 

35**Explore**35> [tab] Explore

36 36>

37A fast, read-only agent optimized for searching and analyzing codebases.37> A fast, read-only agent optimized for searching and analyzing codebases.

38 38>

39* **Model**: the main conversation's model. When the main conversation runs Fable, Explore's model depends on how you connect:39> * **Model**: the main conversation's model. When the main conversation runs Fable, Explore's model depends on how you connect:

40 * With a Claude subscription, an Anthropic Console account, or an [LLM gateway](https://code.claude.com/docs/en/llm-gateway) reached through `ANTHROPIC_BASE_URL`, Explore runs on the Opus model that the [`opus` alias](https://code.claude.com/docs/en/model-config#model-aliases) resolves to.40> * With a Claude subscription, an Anthropic Console account, or an [LLM gateway](https://code.claude.com/docs/en/llm-gateway) reached through `ANTHROPIC_BASE_URL`, Explore runs on the Opus model that the [`opus` alias](https://code.claude.com/docs/en/model-config#model-aliases) resolves to.

41 * On Amazon Bedrock, Google Cloud's Agent Platform, Microsoft Foundry, [Claude Platform on AWS](https://code.claude.com/docs/en/claude-platform-on-aws.md), or a [Claude apps gateway](https://code.claude.com/docs/en/claude-apps-gateway), Explore stays on the main conversation's model.41> * On Amazon Bedrock, Google Cloud's Agent Platform, Microsoft Foundry, [Claude Platform on AWS](https://code.claude.com/docs/en/claude-platform-on-aws.md), or a [Claude apps gateway](https://code.claude.com/docs/en/claude-apps-gateway), Explore stays on the main conversation's model.

42* **Tools**: read-only tools; Write and Edit are denied42> * **Tools**: read-only tools; Write and Edit are denied

43* **Purpose**: file discovery, code search, codebase exploration43> * **Purpose**: file discovery, code search, codebase exploration

44 44>

45A [user or project subagent](#choose-the-subagent-scope) named `Explore` overrides the built-in and keeps its own `model` field, so define one with `model: haiku` to run exploration on a lower-cost model. To force one model onto every subagent, Explore included, see [Run every subagent on one model](#run-every-subagent-on-one-model).45> A [user or project subagent](#choose-the-subagent-scope) named `Explore` overrides the built-in and keeps its own `model` field, so define one with `model: haiku` to run exploration on a lower-cost model. To force one model onto every subagent, Explore included, see [Run every subagent on one model](#run-every-subagent-on-one-model).

46 46>

47Claude delegates to Explore when it needs to search or understand a codebase without making changes. This keeps exploration results out of your main conversation context.47> Claude delegates to Explore when it needs to search or understand a codebase without making changes. This keeps exploration results out of your main conversation context.

48 48>

49When invoking Explore, Claude specifies a thoroughness level: **quick** for targeted lookups, **medium** for balanced exploration, or **very thorough** for comprehensive analysis.49> When invoking Explore, Claude specifies a thoroughness level: **quick** for targeted lookups, **medium** for balanced exploration, or **very thorough** for comprehensive analysis.

50 

51**Plan**

52 

53A research agent used during [plan mode](https://code.claude.com/docs/en/permission-modes.md#analyze-before-you-edit-with-plan-mode) to gather context before presenting a plan.

54 

55* **Model**: inherits from the main conversation, unless you set `CLAUDE_CODE_SUBAGENT_MODEL` and [force it onto every subagent](#run-every-subagent-on-one-model)

56* **Tools**: read-only tools; Write and Edit are denied

57* **Purpose**: codebase research for planning

58 

59When you're in plan mode and Claude needs to understand your codebase, it delegates research to the Plan subagent so that exploration output stays in a separate context window while the main conversation remains read-only.

60 

61**General-purpose**

62 

63A capable agent for complex, multi-step tasks that require both exploration and action.

64 

65* **Model**: the [`CLAUDE_CODE_SUBAGENT_MODEL`](#choose-a-model) model if you set one and nothing assigns a model another way, otherwise the main conversation's model; [Choose a model](#choose-a-model) states the full order, and [Run every subagent on one model](#run-every-subagent-on-one-model) shows how to make the variable override those sources

66* **Tools**: every tool [available to subagents](#available-tools)

67* **Purpose**: complex research, multi-step operations, code modifications

68 

69Claude delegates to general-purpose when the task requires both exploration and modification, complex reasoning to interpret results, or multiple dependent steps.

70 50 

71**Other**51> [tab] Plan

52>

53> A research agent used during [plan mode](https://code.claude.com/docs/en/permission-modes.md#analyze-before-you-edit-with-plan-mode) to gather context before presenting a plan.

54>

55> * **Model**: inherits from the main conversation, unless you set `CLAUDE_CODE_SUBAGENT_MODEL` and [force it onto every subagent](#run-every-subagent-on-one-model)

56> * **Tools**: read-only tools; Write and Edit are denied

57> * **Purpose**: codebase research for planning

58>

59> When you're in plan mode and Claude needs to understand your codebase, it delegates research to the Plan subagent so that exploration output stays in a separate context window while the main conversation remains read-only.

72 60 

73Claude Code includes additional helper agents for specific tasks. These are typically invoked automatically, so you don't need to use them directly.61> [tab] General-purpose

62>

63> A capable agent for complex, multi-step tasks that require both exploration and action.

64>

65> * **Model**: the [`CLAUDE_CODE_SUBAGENT_MODEL`](#choose-a-model) model if you set one and nothing assigns a model another way, otherwise the main conversation's model; [Choose a model](#choose-a-model) states the full order, and [Run every subagent on one model](#run-every-subagent-on-one-model) shows how to make the variable override those sources

66> * **Tools**: every tool [available to subagents](#available-tools)

67> * **Purpose**: complex research, multi-step operations, code modifications

68>

69> Claude delegates to general-purpose when the task requires both exploration and modification, complex reasoning to interpret results, or multiple dependent steps.

74 70 

75| Agent | Model | When Claude uses it |71> [tab] Other

76| :- | :- | :- |72>

77| claude | None of its own; follows the [model order](#choose-a-model) when Claude spawns it as a subagent | When a task doesn't fit a more specialized agent. A catch-all with every tool [available to subagents](#available-tools). Also the default agent for a dispatched [background session](https://code.claude.com/docs/en/agent-view.md); [which permission mode it starts in](https://code.claude.com/docs/en/agent-view.md#permission-mode-model-and-effort) depends on how the session was started |73> Claude Code includes additional helper agents for specific tasks. These are typically invoked automatically, so you don't need to use them directly.

78| statusline-setup | Sonnet | When you run `/statusline` to configure your status line |74>

79| claude-code-guide | Haiku | When you ask questions about Claude Code features |75> | Agent | Model | When Claude uses it |

76> | :- | :- | :- |

77> | claude | None of its own; follows the [model order](#choose-a-model) when Claude spawns it as a subagent | When a task doesn't fit a more specialized agent. A catch-all with every tool [available to subagents](#available-tools). Also the default agent for a dispatched [background session](https://code.claude.com/docs/en/agent-view.md); [which permission mode it starts in](https://code.claude.com/docs/en/agent-view.md#permission-mode-model-and-effort) depends on how the session was started |

78> | statusline-setup | Sonnet | When you run `/statusline` to configure your status line |

79> | claude-code-guide | Haiku | When you ask questions about Claude Code features |

80 80 

81Built-in subagents are registered by default in interactive sessions. To restrict them:81Built-in subagents are registered by default in interactive sessions. To restrict them:

82 82 


179 179 

180**CLI-defined subagents** are passed as JSON when launching Claude Code. They exist only for that session and aren't saved to disk, making them useful for quick testing or automation scripts. You can define multiple subagents in a single `--agents` call:180**CLI-defined subagents** are passed as JSON when launching Claude Code. They exist only for that session and aren't saved to disk, making them useful for quick testing or automation scripts. You can define multiple subagents in a single `--agents` call:

181 181 

182**macOS, Linux, WSL**182> [tab] macOS, Linux, WSL

183 183>

184```bash theme={null}184> ```bash theme={null}

185claude --agents '{185> claude --agents '{

186 "code-reviewer": {186> "code-reviewer": {

187 "description": "Expert code reviewer. Use proactively after code changes.",187> "description": "Expert code reviewer. Use proactively after code changes.",

188 "prompt": "You are a senior code reviewer. Focus on code quality, security, and best practices.",188> "prompt": "You are a senior code reviewer. Focus on code quality, security, and best practices.",

189 "tools": ["Read", "Grep", "Glob", "Bash"],189> "tools": ["Read", "Grep", "Glob", "Bash"],

190 "model": "sonnet"190> "model": "sonnet"

191 },191> },

192 "debugger": {192> "debugger": {

193 "description": "Debugging specialist for errors and test failures.",193> "description": "Debugging specialist for errors and test failures.",

194 "prompt": "You are an expert debugger. Analyze errors, identify root causes, and provide fixes."194> "prompt": "You are an expert debugger. Analyze errors, identify root causes, and provide fixes."

195 }195> }

196}'196> }'

197```197> ```

198 198 

199**Windows PowerShell**199> [tab] Windows PowerShell

200 200>

201```powershell theme={null}201> ```powershell theme={null}

202claude --agents @'202> claude --agents @'

203{203> {

204 "code-reviewer": {204> "code-reviewer": {

205 "description": "Expert code reviewer. Use proactively after code changes.",205> "description": "Expert code reviewer. Use proactively after code changes.",

206 "prompt": "You are a senior code reviewer. Focus on code quality, security, and best practices.",206> "prompt": "You are a senior code reviewer. Focus on code quality, security, and best practices.",

207 "tools": ["Read", "Grep", "Glob", "Bash"],207> "tools": ["Read", "Grep", "Glob", "Bash"],

208 "model": "sonnet"208> "model": "sonnet"

209 },209> },

210 "debugger": {210> "debugger": {

211 "description": "Debugging specialist for errors and test failures.",211> "description": "Debugging specialist for errors and test failures.",

212 "prompt": "You are an expert debugger. Analyze errors, identify root causes, and provide fixes."212> "prompt": "You are an expert debugger. Analyze errors, identify root causes, and provide fixes."

213 }213> }

214}214> }

215'@215> '@

216```216> ```

217 217 

218In [non-interactive mode](https://code.claude.com/docs/en/headless.md), `--agents` also accepts the path to a JSON file holding the same object, for definitions too large to pass on the command line. For example, `claude -p --agents ./agents.json "Review my changes"` reads the definitions from that file. In an interactive session, Claude Code refuses a file path. The file form requires Claude Code v2.1.281 or later.218In [non-interactive mode](https://code.claude.com/docs/en/headless.md), `--agents` also accepts the path to a JSON file holding the same object, for definitions too large to pass on the command line. For example, `claude -p --agents ./agents.json "Review my changes"` reads the definitions from that file. In an interactive session, Claude Code refuses a file path. The file form requires Claude Code v2.1.281 or later.

219 219 

terminal-config.md +16 −16

Details

48 48 

49Some Claude Code shortcuts use the Option key, such as Option+Enter for a newline or Option+P to switch models. On macOS, most terminals do not send Option as a modifier by default, so these shortcuts do nothing until you enable it. The terminal setting for this is usually labeled "Use Option as Meta Key"; Meta is the historical Unix name for the key now labeled Option or Alt.49Some Claude Code shortcuts use the Option key, such as Option+Enter for a newline or Option+P to switch models. On macOS, most terminals do not send Option as a modifier by default, so these shortcuts do nothing until you enable it. The terminal setting for this is usually labeled "Use Option as Meta Key"; Meta is the historical Unix name for the key now labeled Option or Alt.

50 50 

51**Apple Terminal**51> [tab] Apple Terminal

52 52>

53Open Settings → Profiles → Keyboard and check "Use Option as Meta Key".53> Open Settings → Profiles → Keyboard and check "Use Option as Meta Key".

54 54>

55If you accepted Claude Code's first-run terminal setup prompt, this is already done. That prompt runs `/terminal-setup` for you, which enables Option as Meta and turns off the audible bell in your Apple Terminal profile.55> If you accepted Claude Code's first-run terminal setup prompt, this is already done. That prompt runs `/terminal-setup` for you, which enables Option as Meta and turns off the audible bell in your Apple Terminal profile.

56 56>

57In [screen reader mode](https://code.claude.com/docs/en/accessibility.md), `/terminal-setup` leaves the bell setting unchanged so the terminal bell stays audible. If an earlier run turned the bell off, turn it back on under Settings → Profiles → Advanced → "Audible bell".57> In [screen reader mode](https://code.claude.com/docs/en/accessibility.md), `/terminal-setup` leaves the bell setting unchanged so the terminal bell stays audible. If an earlier run turned the bell off, turn it back on under Settings → Profiles → Advanced → "Audible bell".

58 

59**iTerm2**

60 

61Open Settings → Profiles → Keys → General and set Left Option key and Right Option key to "Esc+".

62 

63Running `/terminal-setup` in iTerm2 enables "Applications in terminal may access clipboard" under Settings → General → Selection so the `/copy` command can write to your system clipboard. The command detects iTerm2 even when run from inside tmux. Restart iTerm2 for the change to take effect.

64 58 

65**VS Code**59> [tab] iTerm2

60>

61> Open Settings → Profiles → Keys → General and set Left Option key and Right Option key to "Esc+".

62>

63> Running `/terminal-setup` in iTerm2 enables "Applications in terminal may access clipboard" under Settings → General → Selection so the `/copy` command can write to your system clipboard. The command detects iTerm2 even when run from inside tmux. Restart iTerm2 for the change to take effect.

66 64 

67Add `"terminal.integrated.macOptionIsMeta": true` to your VS Code settings.65> [tab] VS Code

66>

67> Add `"terminal.integrated.macOptionIsMeta": true` to your VS Code settings.

68 68 

69For Ghostty, Kitty, and other terminals, look for an Option-as-Alt or Option-as-Meta setting in the terminal's configuration file.69For Ghostty, Kitty, and other terminals, look for an Option-as-Alt or Option-as-Meta setting in the terminal's configuration file.

70 70 


188 188 

189The reference below covers the tokens you can set in `overrides`. The interactive editor in `/theme` shows the same tokens with a live preview, plus a few single-purpose accents such as onboarding screen colors that are omitted here.189The reference below covers the tokens you can set in `overrides`. The interactive editor in `/theme` shows the same tokens with a live preview, plus a few single-purpose accents such as onboarding screen colors that are omitted here.

190 190 

191> **Color token reference**191> [accordion] Color token reference

192>192>

193> The following example combines tokens from several of the groups below: the brand accent, the plan mode border, the diff backgrounds, and the message background.193> The following example combines tokens from several of the groups below: the brand accent, the plan mode border, the diff backgrounds, and the message background.

194>194>

Details

19| Tool | Description | Permission required |19| Tool | Description | Permission required |

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

21| `Agent` | Spawns a [subagent](https://code.claude.com/docs/en/sub-agents.md) with its own context window to handle a task. With [agent teams](https://code.claude.com/docs/en/agent-teams.md) enabled, a call that carries a `name` can launch a [teammate](https://code.claude.com/docs/en/agent-teams.md#how-claude-starts-agent-teams) instead. See [Agent tool behavior](#agent-tool-behavior) | No |21| `Agent` | Spawns a [subagent](https://code.claude.com/docs/en/sub-agents.md) with its own context window to handle a task. With [agent teams](https://code.claude.com/docs/en/agent-teams.md) enabled, a call that carries a `name` can launch a [teammate](https://code.claude.com/docs/en/agent-teams.md#how-claude-starts-agent-teams) instead. See [Agent tool behavior](#agent-tool-behavior) | No |

22| `Artifact` | Publishes an HTML or Markdown file as an [artifact](https://code.claude.com/docs/en/artifacts.md): a private, interactive page on claude.ai. You can share it with a public link, or inside your organization on Team and Enterprise plans, where public sharing requires an Owner to [enable it](https://code.claude.com/docs/en/artifacts.md#control-public-sharing). Requires a Pro, Max, Team, or Enterprise plan and `/login` authentication; see [Availability](https://code.claude.com/docs/en/artifacts.md#availability) | Yes |22| `Artifact` | Publishes an HTML or Markdown file to claude.ai as an [artifact](https://code.claude.com/docs/en/artifacts.md): a private, interactive page. You can share it with a public link, or inside your organization on Team and Enterprise plans, where public sharing requires an Owner to [enable it](https://code.claude.com/docs/en/artifacts.md#control-public-sharing). Requires a Pro, Max, Ultra, Team, or Enterprise plan and `/login` authentication; see [Availability](https://code.claude.com/docs/en/artifacts.md#availability) | Yes |

23| `AskUserQuestion` | Asks multiple-choice questions to gather requirements or clarify ambiguity. Questions stay open until you answer them by default. See [AskUserQuestion tool behavior](#askuserquestion-tool-behavior) | No |23| `AskUserQuestion` | Asks multiple-choice questions to gather requirements or clarify ambiguity. Questions stay open until you answer them by default. See [AskUserQuestion tool behavior](#askuserquestion-tool-behavior) | No |

24| `Bash` | Executes shell commands in your environment. See [Bash tool behavior](#bash-tool-behavior) | Yes |24| `Bash` | Executes shell commands in your environment. See [Bash tool behavior](#bash-tool-behavior) | Yes |

25| `CronCreate` | Schedules a recurring or one-shot prompt within the current session. Tasks are session-scoped and restored on `--resume` or `--continue` if unexpired. See [session-scoped scheduled tasks](https://code.claude.com/docs/en/scheduled-tasks.md) | No |25| `CronCreate` | Schedules a recurring or one-shot prompt within the current session. Tasks are session-scoped and restored on `--resume` or `--continue` if unexpired. See [session-scoped scheduled tasks](https://code.claude.com/docs/en/scheduled-tasks.md) | No |


42| `PushNotification` | Sends a desktop notification, and a phone push when [Remote Control](https://code.claude.com/docs/en/remote-control.md) is connected, so a long-running task or [session-scoped scheduled task](https://code.claude.com/docs/en/scheduled-tasks.md) can reach you when you step away. Push delivery runs through Anthropic-hosted infrastructure, which is not accessible from Amazon Bedrock, Claude Platform on AWS, Google Cloud's Agent Platform, or Microsoft Foundry | No |42| `PushNotification` | Sends a desktop notification, and a phone push when [Remote Control](https://code.claude.com/docs/en/remote-control.md) is connected, so a long-running task or [session-scoped scheduled task](https://code.claude.com/docs/en/scheduled-tasks.md) can reach you when you step away. Push delivery runs through Anthropic-hosted infrastructure, which is not accessible from Amazon Bedrock, Claude Platform on AWS, Google Cloud's Agent Platform, or Microsoft Foundry | No |

43| `Read` | Reads the contents of files. See [Read tool behavior](#read-tool-behavior) | No |43| `Read` | Reads the contents of files. See [Read tool behavior](#read-tool-behavior) | No |

44| `ReadMcpResourceTool` | Reads a specific MCP resource by URI | No |44| `ReadMcpResourceTool` | Reads a specific MCP resource by URI | No |

45| `RemoteTrigger` | Creates, updates, runs, and lists [cloud scheduled tasks](https://code.claude.com/docs/en/routines.md), formerly routines, on claude.ai. Backs the `/schedule` command. The [`RemoteTrigger` input reference](https://code.claude.com/docs/en/agent-sdk/typescript#remotetrigger) documents every action and the organization policies that remove the tool. Cloud scheduled tasks live on claude.ai and require a Pro, Max, Team, or Enterprise plan. This tool is therefore not accessible from Amazon Bedrock, Claude Platform on AWS, Google Cloud's Agent Platform, or Microsoft Foundry | No |45| `RemoteTrigger` | Creates, updates, runs, and lists [cloud scheduled tasks](https://code.claude.com/docs/en/routines.md), formerly routines, on claude.ai. Backs the `/schedule` command. The [`RemoteTrigger` input reference](https://code.claude.com/docs/en/agent-sdk/typescript#remotetrigger) documents every action and the organization policies that remove the tool. Cloud scheduled tasks live on claude.ai and require a Pro, Max, Ultra, Team, or Enterprise plan. This tool is therefore not accessible from Amazon Bedrock, Claude Platform on AWS, Google Cloud's Agent Platform, or Microsoft Foundry | No |

46| `ReportFindings` | Reports code-review findings as a structured list, with a file, summary, and failure scenario per finding, so Claude Code can render them instead of printing them as text. Claude calls it when active code-review instructions tell it to. A finding can also carry an optional `category` slug, such as `correctness` or `test-coverage`, shown next to the file location in the rendered list | No |46| `ReportFindings` | Reports code-review findings as a structured list, with a file, summary, and failure scenario per finding, so Claude Code can render them instead of printing them as text. Claude calls it when active code-review instructions tell it to. A finding can also carry an optional `category` slug, such as `correctness` or `test-coverage`, shown next to the file location in the rendered list | No |

47| `ScheduleWakeup` | Reschedules the next iteration of a [self-paced `/loop`](https://code.claude.com/docs/en/scheduled-tasks#let-claude-choose-the-interval). Claude calls this at the end of each iteration to pick when the next one runs, between one minute and one hour out; you don't call it directly. To end the loop instead, Claude calls it with `stop: true`, which cancels the pending wakeup. The pending wakeup appears in `session_crons` in [Stop hook input](https://code.claude.com/docs/en/hooks.md#stop-input) | No |47| `ScheduleWakeup` | Reschedules the next iteration of a [self-paced `/loop`](https://code.claude.com/docs/en/scheduled-tasks#let-claude-choose-the-interval). Claude calls this at the end of each iteration to pick when the next one runs, between one minute and one hour out; you don't call it directly. To end the loop instead, Claude calls it with `stop: true`, which cancels the pending wakeup. The pending wakeup appears in `session_crons` in [Stop hook input](https://code.claude.com/docs/en/hooks.md#stop-input) | No |

48| `SendFeedback` | Drafts a feedback report about Claude Code, covering a product problem or Claude's own behavior in the session, and queues it on your machine for you to review. Claude Code sends nothing until you choose to send the draft. See [SendFeedback tool behavior](#sendfeedback-tool-behavior). Requires Claude Code v2.1.238 or later | No |48| `SendFeedback` | Drafts a feedback report about Claude Code, covering a product problem or Claude's own behavior in the session, and queues it on your machine for you to review. Claude Code sends nothing until you choose to send the draft. See [SendFeedback tool behavior](#sendfeedback-tool-behavior). Requires Claude Code v2.1.238 or later | No |

Details

75 75 

76The installer downloads from `downloads.claude.ai`. Verify you can reach it:76The installer downloads from `downloads.claude.ai`. Verify you can reach it:

77 77 

78**macOS/Linux**78> [tab] macOS/Linux

79 79>

80```bash theme={null}80> ```bash theme={null}

81curl -sI https://downloads.claude.ai/claude-code-releases/latest81> curl -sI https://downloads.claude.ai/claude-code-releases/latest

82```82> ```

83 

84**Windows PowerShell**

85 

86```powershell theme={null}

87curl.exe -sI https://downloads.claude.ai/claude-code-releases/latest

88```

89 83 

90PowerShell aliases `curl` to `Invoke-WebRequest`, which rejects the `-sI` flags, so call `curl.exe` explicitly.84> [tab] Windows PowerShell

85>

86> ```powershell theme={null}

87> curl.exe -sI https://downloads.claude.ai/claude-code-releases/latest

88> ```

89>

90> PowerShell aliases `curl` to `Invoke-WebRequest`, which rejects the `-sI` flags, so call `curl.exe` explicitly.

91 91 

92You reached the server if the first line shows a `200` status. You see `HTTP/2 200` on macOS and Linux, and `HTTP/1.1 200 OK` from the `curl.exe` included with Windows. Other results point to the cause:92You reached the server if the first line shows a `200` status. You see `HTTP/2 200` on macOS and Linux, and `HTTP/1.1 200 OK` from the `curl.exe` included with Windows. Other results point to the cause:

93 93 


104 104 

105This example sets both proxy variables, then runs the installer through your proxy:105This example sets both proxy variables, then runs the installer through your proxy:

106 106 

107**macOS/Linux**107> [tab] macOS/Linux

108 108>

109```bash theme={null}109> ```bash theme={null}

110export HTTP_PROXY=http://proxy.example.com:8080110> export HTTP_PROXY=http://proxy.example.com:8080

111export HTTPS_PROXY=http://proxy.example.com:8080111> export HTTPS_PROXY=http://proxy.example.com:8080

112curl -fsSL https://claude.ai/install.sh | bash112> curl -fsSL https://claude.ai/install.sh | bash

113```113> ```

114 

115**Windows PowerShell**

116 114 

117```powershell theme={null}115> [tab] Windows PowerShell

118$env:HTTP_PROXY = 'http://proxy.example.com:8080'116>

119$env:HTTPS_PROXY = 'http://proxy.example.com:8080'117> ```powershell theme={null}

120irm https://claude.ai/install.ps1 | iex118> $env:HTTP_PROXY = 'http://proxy.example.com:8080'

121```119> $env:HTTPS_PROXY = 'http://proxy.example.com:8080'

120> irm https://claude.ai/install.ps1 | iex

121> ```

122 122 

123### Verify your PATH123### Verify your PATH

124 124 


132 132 

133First check that the program is there at all, then check whether its folder is in your PATH. The PATH fix is permanent, so you apply it once. Pick your platform's tab and run its commands there: in your terminal on macOS and Linux, or in PowerShell or Command Prompt on Windows.133First check that the program is there at all, then check whether its folder is in your PATH. The PATH fix is permanent, so you apply it once. Pick your platform's tab and run its commands there: in your terminal on macOS and Linux, or in PowerShell or Command Prompt on Windows.

134 134 

135**macOS/Linux**135> [tab] macOS/Linux

136 136>

137Check that the installer put the program in place:137> Check that the installer put the program in place:

138 138>

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

140ls -la ~/.local/bin/claude140> ls -la ~/.local/bin/claude

141```141> ```

142 142>

143* **`No such file or directory`**: there's no native install. If you haven't installed Claude Code another way, such as with npm, Homebrew, or a Linux package manager, [install Claude Code](https://code.claude.com/docs/en/setup.md#install-claude-code). If you installed it another way, see [Check for conflicting installations](#check-for-conflicting-installations).143> * **`No such file or directory`**: there's no native install. If you haven't installed Claude Code another way, such as with npm, Homebrew, or a Linux package manager, [install Claude Code](https://code.claude.com/docs/en/setup.md#install-claude-code). If you installed it another way, see [Check for conflicting installations](#check-for-conflicting-installations).

144* **A listing for the file**: the program is there. Check your PATH next.144> * **A listing for the file**: the program is there. Check your PATH next.

145 145>

146List your PATH entries and filter for the install folder:146> List your PATH entries and filter for the install folder:

147 147>

148```bash theme={null}148> ```bash theme={null}

149echo $PATH | tr ':' '\n' | grep -Fx "$HOME/.local/bin"149> echo $PATH | tr ':' '\n' | grep -Fx "$HOME/.local/bin"

150```150> ```

151 151>

152If this prints `/Users/you/.local/bin` or `/home/you/.local/bin`, the directory is in your PATH and you can skip to [Check for conflicting installations](#check-for-conflicting-installations). If there's no output, add it to your shell configuration with the two commands for your shell. The `echo` command saves the setting for every new terminal, and `source` applies it to the window you're in. The `echo` command prints nothing when it succeeds.152> If this prints `/Users/you/.local/bin` or `/home/you/.local/bin`, the directory is in your PATH and you can skip to [Check for conflicting installations](#check-for-conflicting-installations). If there's no output, add it to your shell configuration with the two commands for your shell. The `echo` command saves the setting for every new terminal, and `source` applies it to the window you're in. The `echo` command prints nothing when it succeeds.

153 153>

154For Zsh, the default on macOS:154> For Zsh, the default on macOS:

155 155>

156```bash theme={null}156> ```bash theme={null}

157echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc157> echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc

158source ~/.zshrc158> source ~/.zshrc

159```159> ```

160 160>

161For Bash on Linux, where it's the default on most distributions:161> For Bash on Linux, where it's the default on most distributions:

162 162>

163```bash theme={null}163> ```bash theme={null}

164echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc164> echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc

165source ~/.bashrc165> source ~/.bashrc

166```166> ```

167 167>

168For Bash on macOS, add the line to `~/.bash_profile` instead. Terminal on macOS starts Bash as a login shell, which ignores `~/.bashrc` and reads only the first of `~/.bash_profile`, `~/.bash_login`, or `~/.profile` that exists. If you already have a `~/.bash_login` or `~/.profile` and no `~/.bash_profile`, put the line in that file rather than creating `~/.bash_profile`:168> For Bash on macOS, add the line to `~/.bash_profile` instead. Terminal on macOS starts Bash as a login shell, which ignores `~/.bashrc` and reads only the first of `~/.bash_profile`, `~/.bash_login`, or `~/.profile` that exists. If you already have a `~/.bash_login` or `~/.profile` and no `~/.bash_profile`, put the line in that file rather than creating `~/.bash_profile`:

169 169>

170```bash theme={null}170> ```bash theme={null}

171echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bash_profile171> echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bash_profile

172source ~/.bash_profile172> source ~/.bash_profile

173```173> ```

174 174>

175Alternatively, close and reopen your terminal.175> Alternatively, close and reopen your terminal.

176 176>

177If the `echo` command prints `permission denied`, see [`permission denied` when adding to your PATH](#permission-denied-when-adding-to-your-path).177> If the `echo` command prints `permission denied`, see [`permission denied` when adding to your PATH](#permission-denied-when-adding-to-your-path).

178 178>

179For other shells such as fish or Nushell, add `~/.local/bin` to your PATH using your shell's own configuration syntax, then restart your terminal.179> For other shells such as fish or Nushell, add `~/.local/bin` to your PATH using your shell's own configuration syntax, then restart your terminal.

180 180>

181Verify the fix worked:181> Verify the fix worked:

182 182>

183```bash theme={null}183> ```bash theme={null}

184claude --version184> claude --version

185```185> ```

186 186>

187If `claude` is still not found, check these causes:187> If `claude` is still not found, check these causes:

188 188>

189* **The terminal predates the change**: a window that was already open keeps its old PATH, and a terminal inside an editor takes its PATH from the editor. Open a new window, or quit and reopen the editor.189> * **The terminal predates the change**: a window that was already open keeps its old PATH, and a terminal inside an editor takes its PATH from the editor. Open a new window, or quit and reopen the editor.

190* **The line wasn't saved**: run `grep -n '.local/bin' ~/.zshrc`, using your shell's file name. It prints the line with its line number when the line is there. If it prints nothing, run the two PATH commands again.190> * **The line wasn't saved**: run `grep -n '.local/bin' ~/.zshrc`, using your shell's file name. It prints the line with its line number when the line is there. If it prints nothing, run the two PATH commands again.

191* **The line went to another shell's file**: run `echo $0` to see your shell, then run the two PATH commands for that shell.191> * **The line went to another shell's file**: run `echo $0` to see your shell, then run the two PATH commands for that shell.

192 

193**Windows PowerShell**

194 

195Check that the installer put the program in place:

196 

197```powershell theme={null}

198Test-Path "$env:USERPROFILE\.local\bin\claude.exe"

199```

200 

201* **`False`**: there's no native install. If you haven't installed Claude Code another way, such as with npm or WinGet, [install Claude Code](https://code.claude.com/docs/en/setup.md#install-claude-code). If you installed it another way, see [Check for conflicting installations](#check-for-conflicting-installations).

202* **`True`**: the program is there. Check your PATH next.

203 

204List your PATH entries and filter for the install folder:

205 

206```powershell theme={null}

207$env:PATH -split ';' | Select-String '\.local\\bin'

208```

209 

210If this prints `C:\Users\you\.local\bin`, the directory is in your PATH and you can skip to [Check for conflicting installations](#check-for-conflicting-installations). If there's no output, add the install directory to your User PATH:

211 

212```powershell theme={null}

213$currentPath = [Environment]::GetEnvironmentVariable('PATH', 'User')

214[Environment]::SetEnvironmentVariable('PATH', "$currentPath;$env:USERPROFILE\.local\bin", 'User')

215```

216 

217Restart your terminal for the change to take effect.

218 

219Verify the fix worked:

220 

221```powershell theme={null}

222claude --version

223```

224 

225If `claude` is still not found in a new terminal, check these causes:

226 

227* **The terminal runs inside an editor**: it takes its PATH from the editor, so quit and reopen the editor.

228* **The change wasn't saved**: run `[Environment]::GetEnvironmentVariable('PATH', 'User')` and look for `.local\bin` in the PATH it prints. If it's missing, run the two commands again.

229 

230**Windows CMD**

231 

232Check that the installer put the program in place:

233 

234```batch theme={null}

235dir "%USERPROFILE%\.local\bin\claude.exe"

236```

237 

238* **`File Not Found` or `The system cannot find the path specified.`**: there's no native install. If you haven't installed Claude Code another way, such as with npm or WinGet, [install Claude Code](https://code.claude.com/docs/en/setup.md#install-claude-code). If you installed it another way, see [Check for conflicting installations](#check-for-conflicting-installations).

239* **A listing for `claude.exe`**: the program is there. Check your PATH next.

240 

241List your PATH entries and filter for the install folder:

242 

243```batch theme={null}

244echo %PATH% | findstr /i "local\bin"

245```

246 

247If there's no output, open System Settings, go to Environment Variables, and add `%USERPROFILE%\.local\bin` to your User PATH variable. Restart your terminal.

248 

249Verify the fix worked:

250 192 

251```batch theme={null}193> [tab] Windows PowerShell

252claude --version194>

253```195> Check that the installer put the program in place:

196>

197> ```powershell theme={null}

198> Test-Path "$env:USERPROFILE\.local\bin\claude.exe"

199> ```

200>

201> * **`False`**: there's no native install. If you haven't installed Claude Code another way, such as with npm or WinGet, [install Claude Code](https://code.claude.com/docs/en/setup.md#install-claude-code). If you installed it another way, see [Check for conflicting installations](#check-for-conflicting-installations).

202> * **`True`**: the program is there. Check your PATH next.

203>

204> List your PATH entries and filter for the install folder:

205>

206> ```powershell theme={null}

207> $env:PATH -split ';' | Select-String '\.local\\bin'

208> ```

209>

210> If this prints `C:\Users\you\.local\bin`, the directory is in your PATH and you can skip to [Check for conflicting installations](#check-for-conflicting-installations). If there's no output, add the install directory to your User PATH:

211>

212> ```powershell theme={null}

213> $currentPath = [Environment]::GetEnvironmentVariable('PATH', 'User')

214> [Environment]::SetEnvironmentVariable('PATH', "$currentPath;$env:USERPROFILE\.local\bin", 'User')

215> ```

216>

217> Restart your terminal for the change to take effect.

218>

219> Verify the fix worked:

220>

221> ```powershell theme={null}

222> claude --version

223> ```

224>

225> If `claude` is still not found in a new terminal, check these causes:

226>

227> * **The terminal runs inside an editor**: it takes its PATH from the editor, so quit and reopen the editor.

228> * **The change wasn't saved**: run `[Environment]::GetEnvironmentVariable('PATH', 'User')` and look for `.local\bin` in the PATH it prints. If it's missing, run the two commands again.

254 229 

255If `claude` is still not found in a new terminal, a terminal inside an editor takes its PATH from the editor, so quit and reopen the editor too.230> [tab] Windows CMD

231>

232> Check that the installer put the program in place:

233>

234> ```batch theme={null}

235> dir "%USERPROFILE%\.local\bin\claude.exe"

236> ```

237>

238> * **`File Not Found` or `The system cannot find the path specified.`**: there's no native install. If you haven't installed Claude Code another way, such as with npm or WinGet, [install Claude Code](https://code.claude.com/docs/en/setup.md#install-claude-code). If you installed it another way, see [Check for conflicting installations](#check-for-conflicting-installations).

239> * **A listing for `claude.exe`**: the program is there. Check your PATH next.

240>

241> List your PATH entries and filter for the install folder:

242>

243> ```batch theme={null}

244> echo %PATH% | findstr /i "local\bin"

245> ```

246>

247> If there's no output, open System Settings, go to Environment Variables, and add `%USERPROFILE%\.local\bin` to your User PATH variable. Restart your terminal.

248>

249> Verify the fix worked:

250>

251> ```batch theme={null}

252> claude --version

253> ```

254>

255> If `claude` is still not found in a new terminal, a terminal inside an editor takes its PATH from the editor, so quit and reopen the editor too.

256 256 

257### Check for conflicting installations257### Check for conflicting installations

258 258 

259Multiple Claude Code installations can cause version mismatches or unexpected behavior. Check what's installed:259Multiple Claude Code installations can cause version mismatches or unexpected behavior. Check what's installed:

260 260 

261**macOS/Linux**261> [tab] macOS/Linux

262 262>

263List all `claude` binaries found in your PATH:263> List all `claude` binaries found in your PATH:

264 264>

265```bash theme={null}265> ```bash theme={null}

266which -a claude266> which -a claude

267```267> ```

268 268>

269If this prints `claude not found`, a `no claude in` line, or nothing, no `claude` is on your PATH. The next checks show whether one is installed at all.269> If this prints `claude not found`, a `no claude in` line, or nothing, no `claude` is on your PATH. The next checks show whether one is installed at all.

270 270>

271Check the three locations a `claude` binary can come from. `~/.local/bin/claude` is the native installer, `~/.claude/local/` is a legacy local npm install created by older versions of Claude Code, and the npm global list shows a `-g` install:271> Check the three locations a `claude` binary can come from. `~/.local/bin/claude` is the native installer, `~/.claude/local/` is a legacy local npm install created by older versions of Claude Code, and the npm global list shows a `-g` install:

272 272>

273```bash theme={null}273> ```bash theme={null}

274ls -la ~/.local/bin/claude274> ls -la ~/.local/bin/claude

275```275> ```

276 276>

277A native install shows a symlink into `~/.local/share/claude/versions/`. A script or a symlink you created yourself at this path is a custom launcher, which [auto-update leaves in place](https://code.claude.com/docs/en/setup.md#auto-updates).277> A native install shows a symlink into `~/.local/share/claude/versions/`. A script or a symlink you created yourself at this path is a custom launcher, which [auto-update leaves in place](https://code.claude.com/docs/en/setup.md#auto-updates).

278 278>

279If either `ls` command prints `No such file or directory`, that's not an error. It means nothing is installed at that location, so move on to the next check.279> If either `ls` command prints `No such file or directory`, that's not an error. It means nothing is installed at that location, so move on to the next check.

280 280>

281```bash theme={null}281> ```bash theme={null}

282ls -la ~/.claude/local/282> ls -la ~/.claude/local/

283```283> ```

284 284>

285```bash theme={null}285> ```bash theme={null}

286npm -g ls @anthropic-ai/claude-code 2>/dev/null286> npm -g ls @anthropic-ai/claude-code 2>/dev/null

287```287> ```

288 288>

289If `ls -la ~/.local/bin/claude` printed `No such file or directory`, there's no native install. If you haven't installed Claude Code another way, such as with npm, Homebrew, or a Linux package manager, [install Claude Code](https://code.claude.com/docs/en/setup.md#install-claude-code). If `~/.local/bin/claude` exists but `which -a claude` didn't list it, the folder isn't in your PATH: see [Verify your PATH](#verify-your-path).289> If `ls -la ~/.local/bin/claude` printed `No such file or directory`, there's no native install. If you haven't installed Claude Code another way, such as with npm, Homebrew, or a Linux package manager, [install Claude Code](https://code.claude.com/docs/en/setup.md#install-claude-code). If `~/.local/bin/claude` exists but `which -a claude` didn't list it, the folder isn't in your PATH: see [Verify your PATH](#verify-your-path).

290 

291**Windows PowerShell**

292 

293List all `claude` binaries found in your PATH:

294 

295```powershell theme={null}

296where.exe claude

297```

298 

299If this prints `INFO: Could not find files for the given pattern(s).`, no `claude` is on your PATH.

300 

301Check whether the native installer placed a binary:

302 

303```powershell theme={null}

304Test-Path "$env:USERPROFILE\.local\bin\claude.exe"

305```

306 290 

307* **`True`**: the native install is there. If `where.exe` found nothing, its folder isn't in your PATH: see [Verify your PATH](#verify-your-path).291> [tab] Windows PowerShell

308* **`False`**: there's no native install. If you haven't installed Claude Code another way, such as with npm or WinGet, [install Claude Code](https://code.claude.com/docs/en/setup.md#install-claude-code).292>

293> List all `claude` binaries found in your PATH:

294>

295> ```powershell theme={null}

296> where.exe claude

297> ```

298>

299> If this prints `INFO: Could not find files for the given pattern(s).`, no `claude` is on your PATH.

300>

301> Check whether the native installer placed a binary:

302>

303> ```powershell theme={null}

304> Test-Path "$env:USERPROFILE\.local\bin\claude.exe"

305> ```

306>

307> * **`True`**: the native install is there. If `where.exe` found nothing, its folder isn't in your PATH: see [Verify your PATH](#verify-your-path).

308> * **`False`**: there's no native install. If you haven't installed Claude Code another way, such as with npm or WinGet, [install Claude Code](https://code.claude.com/docs/en/setup.md#install-claude-code).

309 309 

310If you find multiple installations, keep only one. The native install at `~/.local/bin/claude` on macOS/Linux or `%USERPROFILE%\.local\bin\claude.exe` on Windows is recommended. Remove the extras:310If you find multiple installations, keep only one. The native install at `~/.local/bin/claude` on macOS/Linux or `%USERPROFILE%\.local\bin\claude.exe` on Windows is recommended. Remove the extras:

311 311 


317 317 

318Remove the legacy local npm install:318Remove the legacy local npm install:

319 319 

320**macOS/Linux**320> [tab] macOS/Linux

321 321>

322```bash theme={null}322> ```bash theme={null}

323rm -rf ~/.claude/local323> rm -rf ~/.claude/local

324```324> ```

325 

326**Windows PowerShell**

327 325 

328```powershell theme={null}326> [tab] Windows PowerShell

329Remove-Item -Recurse -Force "$env:USERPROFILE\.claude\local"327>

330```328> ```powershell theme={null}

329> Remove-Item -Recurse -Force "$env:USERPROFILE\.claude\local"

330> ```

331 331 

332Remove a Homebrew install on macOS. If you installed the `claude-code@latest` cask, substitute that name:332Remove a Homebrew install on macOS. If you installed the `claude-code@latest` cask, substitute that name:

333 333 


376 376 

377Confirm the binary exists and is executable:377Confirm the binary exists and is executable:

378 378 

379**macOS/Linux**379> [tab] macOS/Linux

380 380>

381```bash theme={null}381> ```bash theme={null}

382ls -la "$(command -v claude)"382> ls -la "$(command -v claude)"

383```383> ```

384 

385**Windows PowerShell**

386 384 

387```powershell theme={null}385> [tab] Windows PowerShell

388Get-Command claude | Select-Object Source386>

389```387> ```powershell theme={null}

388> Get-Command claude | Select-Object Source

389> ```

390 390 

391On Linux, check for missing shared libraries. If `ldd` shows missing libraries, you may need to install system packages. On Alpine Linux and other musl-based distributions, see [Alpine Linux setup](https://code.claude.com/docs/en/setup.md#alpine-linux-and-musl-based-distributions).391On Linux, check for missing shared libraries. If `ldd` shows missing libraries, you may need to install system packages. On Alpine Linux and other musl-based distributions, see [Alpine Linux setup](https://code.claude.com/docs/en/setup.md#alpine-linux-and-musl-based-distributions).

392 392 


568 568 

5693. **Check for proxy or firewall interference**: corporate proxies that perform TLS inspection can cause these errors, including `unable to get local issuer certificate` and `SELF_SIGNED_CERT_IN_CHAIN`. For the install step, make the install download trust your corporate proxy's CA:5693. **Check for proxy or firewall interference**: corporate proxies that perform TLS inspection can cause these errors, including `unable to get local issuer certificate` and `SELF_SIGNED_CERT_IN_CHAIN`. For the install step, make the install download trust your corporate proxy's CA:

570 570 

571 **macOS/Linux**571 > [tab] macOS/Linux

572 >

573 > ```bash theme={null}

574 > curl --cacert /path/to/corporate-ca.pem -fsSL https://claude.ai/install.sh | bash

575 > ```

572 576 

573 ```bash theme={null}577 > [tab] Windows PowerShell

574 curl --cacert /path/to/corporate-ca.pem -fsSL https://claude.ai/install.sh | bash578 >

575 ```579 > The PowerShell installer downloads through .NET, which validates TLS against the Windows certificate store. Ask your IT team to add the proxy's CA certificate to the Windows store if it isn't already there, then run the installer:

576 580 >

577 **Windows PowerShell**581 > ```powershell theme={null}

578 582 > irm https://claude.ai/install.ps1 | iex

579 The PowerShell installer downloads through .NET, which validates TLS against the Windows certificate store. Ask your IT team to add the proxy's CA certificate to the Windows store if it isn't already there, then run the installer:583 > ```

580 

581 ```powershell theme={null}

582 irm https://claude.ai/install.ps1 | iex

583 ```

584 584 

585 For Claude Code itself once installed, set `NODE_EXTRA_CA_CERTS` so API requests trust the same bundle:585 For Claude Code itself once installed, set `NODE_EXTRA_CA_CERTS` so API requests trust the same bundle:

586 586 

587 **macOS/Linux**587 > [tab] macOS/Linux

588 588 >

589 ```bash theme={null}589 > ```bash theme={null}

590 export NODE_EXTRA_CA_CERTS=/path/to/corporate-ca.pem590 > export NODE_EXTRA_CA_CERTS=/path/to/corporate-ca.pem

591 ```591 > ```

592 

593 **Windows PowerShell**

594 592 

595 ```powershell theme={null}593 > [tab] Windows PowerShell

596 $env:NODE_EXTRA_CA_CERTS = 'C:\path\to\corporate-ca.pem'594 >

597 ```595 > ```powershell theme={null}

596 > $env:NODE_EXTRA_CA_CERTS = 'C:\path\to\corporate-ca.pem'

597 > ```

598 598 

599 Ask your IT team for the certificate file if you don't have it. You can also try on a direct connection to confirm the proxy is the cause.599 Ask your IT team for the certificate file if you don't have it. You can also try on a direct connection to confirm the proxy is the cause.

600 600 


827 827 

828In every other configuration, rerunning the installer gets past this error, because the script runs the latest release's `install` command even when you ask it to install an older version. Rerun the command for your platform:828In every other configuration, rerunning the installer gets past this error, because the script runs the latest release's `install` command even when you ask it to install an older version. Rerun the command for your platform:

829 829 

830**macOS/Linux**830> [tab] macOS/Linux

831 831>

832```bash theme={null}832> ```bash theme={null}

833curl -fsSL https://claude.ai/install.sh | bash833> curl -fsSL https://claude.ai/install.sh | bash

834```834> ```

835 

836**Windows PowerShell**

837 835 

838```powershell theme={null}836> [tab] Windows PowerShell

839irm https://claude.ai/install.ps1 | iex837>

840```838> ```powershell theme={null}

839> irm https://claude.ai/install.ps1 | iex

840> ```

841 841 

842`claude --version` prints the version the rerun installed.842`claude --version` prints the version the rerun installed.

843 843 


1108 1108 

1109The `npm error path` line names the directory npm couldn't move. Delete that directory and any leftover `.claude-code-*` directories next to it, which earlier interrupted runs can leave behind. The commands below find your global package directory with `npm root -g`; if the directory the `npm error path` line names is not under the directory `npm root -g` prints, for example because you switched Node versions with nvm, delete the directories the error names instead:1109The `npm error path` line names the directory npm couldn't move. Delete that directory and any leftover `.claude-code-*` directories next to it, which earlier interrupted runs can leave behind. The commands below find your global package directory with `npm root -g`; if the directory the `npm error path` line names is not under the directory `npm root -g` prints, for example because you switched Node versions with nvm, delete the directories the error names instead:

1110 1110 

1111**macOS/Linux**1111> [tab] macOS/Linux

1112 1112>

1113```bash theme={null}1113> ```bash theme={null}

1114rm -rf "$(npm root -g)/@anthropic-ai/claude-code"1114> rm -rf "$(npm root -g)/@anthropic-ai/claude-code"

1115```1115> ```

1116 1116>

1117Then remove any leftover temp directories. If Zsh prints `no matches found`, there were none to remove:1117> Then remove any leftover temp directories. If Zsh prints `no matches found`, there were none to remove:

1118 1118>

1119```bash theme={null}1119> ```bash theme={null}

1120rm -rf "$(npm root -g)/@anthropic-ai/.claude-code-"*1120> rm -rf "$(npm root -g)/@anthropic-ai/.claude-code-"*

1121```1121> ```

1122 

1123**Windows PowerShell**

1124 1122 

1125```powershell theme={null}1123> [tab] Windows PowerShell

1126Remove-Item -Recurse -Force "$(npm root -g)/@anthropic-ai/claude-code", "$(npm root -g)/@anthropic-ai/.claude-code-*"1124>

1127```1125> ```powershell theme={null}

1126> Remove-Item -Recurse -Force "$(npm root -g)/@anthropic-ai/claude-code", "$(npm root -g)/@anthropic-ai/.claude-code-*"

1127> ```

1128 1128 

1129Then reinstall. On npm 12, follow [Fix an npm 12 install](#fix-an-npm-12-install). Otherwise, run:1129Then reinstall. On npm 12, follow [Fix an npm 12 install](#fix-an-npm-12-install). Otherwise, run:

1130 1130 


1162 1162 

1163If you see `API Error: 403 Request not allowed` after logging in:1163If you see `API Error: 403 Request not allowed` after logging in:

1164 1164 

1165* **Claude Pro/Max users**: verify your subscription is active at [claude.ai/settings](https://claude.ai/settings)1165* **Claude Pro/Max/Ultra users**: verify your subscription is active at [claude.ai/settings](https://claude.ai/settings)

1166* **Anthropic Console users**: confirm your account has the "Claude Code" or "Developer" role. Admins assign this on the Console's Members page at [platform.claude.com/settings/members](https://platform.claude.com/settings/members).1166* **Anthropic Console users**: confirm your account has the "Claude Code" or "Developer" role. Admins assign this on the Console's Members page at [platform.claude.com/settings/members](https://platform.claude.com/settings/members).

1167* **Behind a proxy**: corporate proxies can interfere with API requests. See [network configuration](https://code.claude.com/docs/en/network-config.md) for proxy setup.1167* **Behind a proxy**: corporate proxies can interfere with API requests. See [network configuration](https://code.claude.com/docs/en/network-config.md) for proxy setup.

1168 1168 


1183 1183 

1184To use your subscription instead, unset the environment variable and remove it from your shell profile:1184To use your subscription instead, unset the environment variable and remove it from your shell profile:

1185 1185 

1186**macOS/Linux**1186> [tab] macOS/Linux

1187 1187>

1188```bash theme={null}1188> ```bash theme={null}

1189unset ANTHROPIC_API_KEY1189> unset ANTHROPIC_API_KEY

1190claude1190> claude

1191```1191> ```

1192 

1193**Windows PowerShell**

1194 1192 

1195```powershell theme={null}1193> [tab] Windows PowerShell

1196Remove-Item Env:ANTHROPIC_API_KEY1194>

1197claude1195> ```powershell theme={null}

1198```1196> Remove-Item Env:ANTHROPIC_API_KEY

1197> claude

1198> ```

1199 1199 

1200Check `~/.zshrc`, `~/.bashrc`, or `~/.profile` for `export ANTHROPIC_API_KEY=...` lines and remove them to make the change permanent. On Windows, check your PowerShell profile at `$PROFILE` and your User environment variables for `ANTHROPIC_API_KEY`. Run `/status` inside Claude Code to confirm which authentication method is active.1200Check `~/.zshrc`, `~/.bashrc`, or `~/.profile` for `export ANTHROPIC_API_KEY=...` lines and remove them to make the change permanent. On Windows, check your PowerShell profile at `$PROFILE` and your User environment variables for `ANTHROPIC_API_KEY`. Run `/status` inside Claude Code to confirm which authentication method is active.

1201 1201 

troubleshooting.md +27 −27

Details

134 134 

135If the Search tool, `@file` mentions, custom agents, or custom skills aren't finding files, the bundled `ripgrep` binary may not run on your system. Install your platform's `ripgrep` package and tell Claude Code to use it instead:135If the Search tool, `@file` mentions, custom agents, or custom skills aren't finding files, the bundled `ripgrep` binary may not run on your system. Install your platform's `ripgrep` package and tell Claude Code to use it instead:

136 136 

137**macOS**137> [tab] macOS

138 138>

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

140brew install ripgrep140> brew install ripgrep

141```141> ```

142 

143**Ubuntu/Debian**

144 

145```bash theme={null}

146sudo apt install ripgrep

147```

148 

149**Alpine**

150 

151```bash theme={null}

152apk add ripgrep

153```

154 

155`ripgrep` is in Alpine's community repository. If `apk` reports that the package is missing, see [Alpine Linux setup](https://code.claude.com/docs/en/setup.md#alpine-linux-and-musl-based-distributions).

156 142 

157**Arch**143> [tab] Ubuntu/Debian

144>

145> ```bash theme={null}

146> sudo apt install ripgrep

147> ```

158 148 

159```bash theme={null}149> [tab] Alpine

160pacman -S ripgrep150>

161```151> ```bash theme={null}

152> apk add ripgrep

153> ```

154>

155> `ripgrep` is in Alpine's community repository. If `apk` reports that the package is missing, see [Alpine Linux setup](https://code.claude.com/docs/en/setup.md#alpine-linux-and-musl-based-distributions).

162 156 

163**Windows**157> [tab] Arch

158>

159> ```bash theme={null}

160> pacman -S ripgrep

161> ```

164 162 

165```powershell theme={null}163> [tab] Windows

166winget install BurntSushi.ripgrep.MSVC164>

167```165> ```powershell theme={null}

166> winget install BurntSushi.ripgrep.MSVC

167> ```

168 168 

169Then set `USE_BUILTIN_RIPGREP` to `0`, either in your shell [environment](https://code.claude.com/docs/en/env-vars.md) or in the `env` block of your [`settings.json`](https://code.claude.com/docs/en/settings-reference#all-settings):169Then set `USE_BUILTIN_RIPGREP` to `0`, either in your shell [environment](https://code.claude.com/docs/en/env-vars.md) or in the `env` block of your [`settings.json`](https://code.claude.com/docs/en/settings-reference#all-settings):

170 170 

ultrareview.md +2 −1

Details

120| - | - | - |120| - | - | - |

121| Pro | 3 free runs | billed as [usage credits](https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans) |121| Pro | 3 free runs | billed as [usage credits](https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans) |

122| Max | 3 free runs | billed as [usage credits](https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans) |122| Max | 3 free runs | billed as [usage credits](https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans) |

123| Ultra | 3 free runs | billed as [usage credits](https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans) |

123 124 

124* **Free runs**: the three Pro and Max runs are a one-time allotment per account and don't refresh.125* **Free runs**: the three Pro, Max, and Ultra runs are a one-time allotment per account and don't refresh.

125* **Cost per review**: after you use the free runs, typically \$5 to \$25 in usage credits depending on the size of the change, matching the estimate the launch dialog shows before each run.126* **Cost per review**: after you use the free runs, typically \$5 to \$25 in usage credits depending on the size of the change, matching the estimate the launch dialog shows before each run.

126* **When a run counts**: once the cloud session starts. A review you stop early or that fails to complete still uses a free run; a paid review bills only for the portion that ran.127* **When a run counts**: once the cloud session starts. A review you stop early or that fails to complete still uses a free run; a paid review bills only for the portion that ran.

127 128 

Details

105 105 

106Voice dictation uses the same [`language` setting](https://code.claude.com/docs/en/settings-reference#language) that controls Claude's response language. If that setting is empty, dictation defaults to English. In the VS Code extension, if `language` is empty, dictation uses VS Code's `accessibility.voice.speechLanguage` setting before defaulting to English.106Voice dictation uses the same [`language` setting](https://code.claude.com/docs/en/settings-reference#language) that controls Claude's response language. If that setting is empty, dictation defaults to English. In the VS Code extension, if `language` is empty, dictation uses VS Code's `accessibility.voice.speechLanguage` setting before defaulting to English.

107 107 

108> **Supported dictation languages**108> [accordion] Supported dictation languages

109>109>

110> | Language | Code |110> | Language | Code |

111> | :- | :- |111> | :- | :- |

vs-code.md +34 −30

Details

23Before installing, make sure you have:23Before installing, make sure you have:

24 24 

25* VS Code 1.94.0 or later25* VS Code 1.94.0 or later

26* An Anthropic account: any paid Claude subscription (Pro, Max, Team, or Enterprise) or a Claude Console account works, and no API key is required. You'll [sign in](https://code.claude.com/docs/en/authentication.md#log-in-to-claude-code) with this account when you first open the extension. If you access Claude through a third-party provider like Amazon Bedrock or Google Cloud's Agent Platform, see [Use third-party providers](#use-third-party-providers) for setup instructions.26* An Anthropic account: any paid Claude subscription (Pro, Max, Ultra, Team, or Enterprise) or a Claude Console account works, and no API key is required. You'll [sign in](https://code.claude.com/docs/en/authentication.md#log-in-to-claude-code) with this account when you first open the extension. If you access Claude through a third-party provider like Amazon Bedrock or Google Cloud's Agent Platform, see [Use third-party providers](#use-third-party-providers) for setup instructions.

27 27 

28> [!TIP]28> [!TIP]

29>29>


38 38 

39Or in VS Code, press `Cmd+Shift+X` (Mac) or `Ctrl+Shift+X` (Windows/Linux) to open the Extensions view, search for "Claude Code", and click **Install**.39Or in VS Code, press `Cmd+Shift+X` (Mac) or `Ctrl+Shift+X` (Windows/Linux) to open the Extensions view, search for "Claude Code", and click **Install**.

40 40 

41> [!NOTE]

42>

43> Extension marketplaces are third-party software, which Anthropic doesn't endorse, maintain, or audit. Anthropic submits extensions for publication to the Visual Studio Marketplace and Open VSX Registry.

44 

41The extension's version number is the Claude Code version it bundles. For example, a feature that requires Claude Code v2.1.286 or later needs version 2.1.286 or later of the extension, which the Extensions view shows.45The extension's version number is the Claude Code version it bundles. For example, a feature that requires Claude Code v2.1.286 or later needs version 2.1.286 or later of the extension, which the Extensions view shows.

42 46 

43Claude Code also runs in other editors and containers:47Claude Code also runs in other editors and containers:

44 48 

45* **Other VS Code forks**: the extension also installs in forks like Devin Desktop or Kiro. Search for "Claude Code" in the editor's Extensions view, or install from the [Open VSX registry](https://open-vsx.org/extension/Anthropic/claude-code).49* **Other VS Code forks**: the extension also installs in forks like Devin Desktop or Kiro. Search for "Claude Code" in the editor's Extensions view, or install from the [Open VSX Registry](https://open-vsx.org/extension/Anthropic/claude-code).

46* **Editors that can't install the extension**: [install the CLI](https://code.claude.com/docs/en/quickstart.md) and run `claude` in the editor's integrated terminal instead. The CLI works in any terminal.50* **Editors that can't install the extension**: [install the CLI](https://code.claude.com/docs/en/quickstart.md) and run `claude` in the editor's integrated terminal instead. The CLI works in any terminal.

47* **Dev containers**: to run Claude Code inside a dev container, see [Development containers](https://code.claude.com/docs/en/devcontainer.md).51* **Dev containers**: to run Claude Code inside a dev container, see [Development containers](https://code.claude.com/docs/en/devcontainer.md).

48 52 


117 121 

118The prompt box supports several features:122The prompt box supports several features:

119 123 

120* **Permission modes**: click the mode indicator at the bottom of the prompt box to switch permission modes. With Claude Code v2.1.283 or later, Auto is the built-in starting permission mode, and on earlier versions only on Pro, Max, and Team plans. See [how the extension chooses the starting permission mode](https://code.claude.com/docs/en/permission-modes.md#switch-permission-modes) for what changes that, and every permission mode the indicator offers.124* **Permission modes**: click the mode indicator at the bottom of the prompt box to switch permission modes. With Claude Code v2.1.283 or later, Auto is the built-in starting permission mode, and on earlier versions only on Pro, Max, Ultra, and Team plans. See [how the extension chooses the starting permission mode](https://code.claude.com/docs/en/permission-modes.md#switch-permission-modes) for what changes that, and every permission mode the indicator offers.

121 * **Auto**: a classifier reviews most actions instead of asking you. See [auto mode](https://code.claude.com/docs/en/permission-modes.md#eliminate-prompts-with-auto-mode) for what it reviews and blocks.125 * **Auto**: a classifier reviews most actions instead of asking you. See [auto mode](https://code.claude.com/docs/en/permission-modes.md#eliminate-prompts-with-auto-mode) for what it reviews and blocks.

122 * **Manual**: Claude asks permission before file edits and most shell commands.126 * **Manual**: Claude asks permission before file edits and most shell commands.

123 * **Plan**: Claude describes what it will do and waits for approval before making changes. VS Code automatically opens the plan as a full Markdown document where you can add inline comments to give feedback before Claude begins.127 * **Plan**: Claude describes what it will do and waits for approval before making changes. VS Code automatically opens the plan as a full Markdown document where you can add inline comments to give feedback before Claude begins.


656 660 

657Invoke the handler with your operating system's URL opener.661Invoke the handler with your operating system's URL opener.

658 662 

659**macOS**663> [tab] macOS

660 664>

661```bash theme={null}665> ```bash theme={null}

662open "vscode://anthropic.claude-code/open"666> open "vscode://anthropic.claude-code/open"

663```667> ```

664 

665**Linux**

666 

667```bash theme={null}

668xdg-open "vscode://anthropic.claude-code/open"

669```

670 

671The `xdg-open` command comes from the `xdg-utils` package. If the shell reports it isn't found, see [xdg-open is not found on Linux](https://code.claude.com/docs/en/deep-links.md#xdg-open-is-not-found-on-linux).

672 

673**Windows**

674 

675In PowerShell:

676 

677```powershell theme={null}

678Start-Process "vscode://anthropic.claude-code/open"

679```

680 668 

681In `cmd.exe`, `start` treats its first quoted argument as a window title, so pass an empty title before the URL:669> [tab] Linux

670>

671> ```bash theme={null}

672> xdg-open "vscode://anthropic.claude-code/open"

673> ```

674>

675> The `xdg-open` command comes from the `xdg-utils` package. If the shell reports it isn't found, see [xdg-open is not found on Linux](https://code.claude.com/docs/en/deep-links.md#xdg-open-is-not-found-on-linux).

682 676 

683```cmd theme={null}677> [tab] Windows

684start "" "vscode://anthropic.claude-code/open"678>

685```679> In PowerShell:

680>

681> ```powershell theme={null}

682> Start-Process "vscode://anthropic.claude-code/open"

683> ```

684>

685> In `cmd.exe`, `start` treats its first quoted argument as a window title, so pass an empty title before the URL:

686>

687> ```cmd theme={null}

688> start "" "vscode://anthropic.claude-code/open"

689> ```

686 690 

687The handler accepts two optional query parameters:691The handler accepts two optional query parameters:

688 692 


704You configure the extension in two places, VS Code's extension settings and the Claude Code settings file:708You configure the extension in two places, VS Code's extension settings and the Claude Code settings file:

705 709 

706* **Extension settings** in VS Code: control the extension's behavior within VS Code. Open with `Cmd+,` (Mac) or `Ctrl+,` (Windows/Linux), then go to **Extensions > Claude Code**. You can also type `/` and select **General config…** to open settings.710* **Extension settings** in VS Code: control the extension's behavior within VS Code. Open with `Cmd+,` (Mac) or `Ctrl+,` (Windows/Linux), then go to **Extensions > Claude Code**. You can also type `/` and select **General config…** to open settings.

707* **Claude Code settings** in `~/.claude/settings.json`: shared between the extension and CLI. Use it for allowed commands, environment variables, hooks, and MCP servers. With Claude Code v2.1.283 or later, it's also one input to the permission mode conversations start in, and on earlier versions only on Pro, Max, and Team plans. [Switch permission modes](https://code.claude.com/docs/en/permission-modes.md#switch-permission-modes) lists the order. See [Settings](https://code.claude.com/docs/en/settings.md) for details.711* **Claude Code settings** in `~/.claude/settings.json`: shared between the extension and CLI. Use it for allowed commands, environment variables, hooks, and MCP servers. With Claude Code v2.1.283 or later, you can also use it as one input to the permission mode conversations start in. On earlier versions, you can do this only on Pro, Max, Ultra, and Team plans. [Switch permission modes](https://code.claude.com/docs/en/permission-modes.md#switch-permission-modes) lists the order. See [Settings](https://code.claude.com/docs/en/settings.md) for details.

708 712 

709> [!TIP]713> [!TIP]

710>714>


933 937 

934* Ensure you have a compatible version of VS Code (1.94.0 or later)938* Ensure you have a compatible version of VS Code (1.94.0 or later)

935* Check that VS Code has permission to install extensions939* Check that VS Code has permission to install extensions

936* Try installing directly from the [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=anthropic.claude-code)940* Try installing directly from the [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=anthropic.claude-code)

937 941 

938### Spark icon not visible942### Spark icon not visible

939 943 

Details

8 8 

9> [!NOTE]9> [!NOTE]

10>10>

11> Cloud sessions are available on Pro, Max, and Team plans, and for Enterprise users with premium seats or Chat + Claude Code seats.11> Cloud sessions are available on Pro, Max, Ultra, and Team plans, and for Enterprise users with premium seats or Chat + Claude Code seats.

12 12 

13A cloud session runs Claude Code on cloud infrastructure instead of your machine, Anthropic-managed by default. This quickstart starts one from [claude.ai/code](https://claude.ai/code) in your browser. You can also start one from the Claude mobile app, the Desktop app, or your terminal with `claude --cloud`.13A cloud session runs Claude Code on cloud infrastructure instead of your machine, Anthropic-managed by default. This quickstart starts one from [claude.ai/code](https://claude.ai/code) in your browser. You can also start one from the Claude mobile app, the Desktop app, or your terminal with `claude --cloud`.

14 14 


77 77 

78A [cloud environment](https://code.claude.com/docs/en/cloud-environments.md) is the saved configuration that controls what network access Claude has during sessions and what runs when a session starts. What happens after you connect GitHub depends on your plan:78A [cloud environment](https://code.claude.com/docs/en/cloud-environments.md) is the saved configuration that controls what network access Claude has during sessions and what runs when a session starts. What happens after you connect GitHub depends on your plan:

79 79 

80* **Pro and Max**: onboarding creates an environment named **Default** for you.80* **Pro, Max, and Ultra**: you get an environment named **Default** automatically.

81* **Team and Enterprise**: onboarding shows a **Create your first cloud environment** form. Leave the prefilled name and network access unchanged and click **Create & finish** to create the **Default** environment. If an Owner has turned on [Quick setup](https://code.claude.com/docs/en/claude-code-on-the-web.md#quick-setup-for-team-and-enterprise), onboarding creates **Default** for you instead.81* **Team and Enterprise**: onboarding shows a **Create your first cloud environment** form. Leave the prefilled name and network access unchanged and click **Create & finish** to create the **Default** environment. If an Owner has turned on [Quick setup](https://code.claude.com/docs/en/claude-code-on-the-web.md#quick-setup-for-team-and-enterprise), onboarding creates **Default** for you instead.

82 82 

83**Default** uses [`Trusted` network access](https://code.claude.com/docs/en/cloud-environments#access-levels): sessions reach [common package registries](https://code.claude.com/docs/en/cloud-environments.md#default-allowed-domains) and other allowlisted domains, and nothing else through the session's network. See [Installed tools](https://code.claude.com/docs/en/cloud-environments.md#installed-tools) for what's available without any configuration.83**Default** uses [`Trusted` network access](https://code.claude.com/docs/en/cloud-environments#access-levels): sessions reach [common package registries](https://code.claude.com/docs/en/cloud-environments.md#default-allowed-domains) and other allowlisted domains, and nothing else through the session's network. See [Installed tools](https://code.claude.com/docs/en/cloud-environments.md#installed-tools) for what's available without any configuration.