SpyBara
Go Premium

Documentation 2026-02-18 03:48 UTC to 2026-02-19 21:06 UTC

16 files changed +191 −108. View all changes and history on the product overview
2026
Sat 28 21:01 Fri 27 21:05 Thu 26 21:08 Wed 25 03:47 Tue 24 21:08 Mon 23 21:13 Sat 21 18:03 Fri 20 21:03 Thu 19 21:06 Wed 18 03:48 Tue 17 21:08 Mon 16 21:05 Sat 14 03:44 Fri 13 21:09 Thu 12 00:06 Wed 11 21:10 Tue 10 21:13 Mon 9 15:17 Sat 7 21:05 Fri 6 21:06 Thu 5 21:06 Wed 4 21:07 Tue 3 21:08 Sun 1 21:03

agent-teams.md +4 −12

Details

78 78 

79From there, Claude creates a team with a [shared task list](/en/interactive-mode#task-list), spawns teammates for each perspective, has them explore the problem, synthesizes findings, and attempts to [clean up the team](#clean-up-the-team) when finished.79From there, Claude creates a team with a [shared task list](/en/interactive-mode#task-list), spawns teammates for each perspective, has them explore the problem, synthesizes findings, and attempts to [clean up the team](#clean-up-the-team) when finished.

80 80 

81The lead's terminal lists all teammates and what they're working on. Use Shift+Up/Down to select a teammate and message them directly.81The lead's terminal lists all teammates and what they're working on. Use Shift+Down to cycle through teammates and message them directly. After the last teammate, Shift+Down wraps back to the lead.

82 82 

83If you want each teammate in its own split pane, see [Choose a display mode](#choose-a-display-mode).83If you want each teammate in its own split pane, see [Choose a display mode](#choose-a-display-mode).

84 84 


90 90 

91Agent teams support two display modes:91Agent teams support two display modes:

92 92 

93* **In-process**: all teammates run inside your main terminal. Use Shift+Up/Down to select a teammate and type to message them directly. Works in any terminal, no extra setup required.93* **In-process**: all teammates run inside your main terminal. Use Shift+Down to cycle through teammates and type to message them directly. Works in any terminal, no extra setup required.

94* **Split panes**: each teammate gets its own pane. You can see everyone's output at once and click into a pane to interact directly. Requires tmux, or iTerm2.94* **Split panes**: each teammate gets its own pane. You can see everyone's output at once and click into a pane to interact directly. Requires tmux, or iTerm2.

95 95 

96<Note>96<Note>


138 138 

139The lead makes approval decisions autonomously. To influence the lead's judgment, give it criteria in your prompt, such as "only approve plans that include test coverage" or "reject plans that modify the database schema."139The lead makes approval decisions autonomously. To influence the lead's judgment, give it criteria in your prompt, such as "only approve plans that include test coverage" or "reject plans that modify the database schema."

140 140 

141### Use delegate mode

142 

143Without delegate mode, the lead sometimes starts implementing tasks itself instead of waiting for teammates. Delegate mode prevents this by restricting the lead to coordination-only tools: spawning, messaging, shutting down teammates, and managing tasks.

144 

145This is useful when you want the lead to focus entirely on orchestration, such as breaking down work, assigning tasks, and synthesizing results, without touching code directly.

146 

147To enable it, start a team first, then press Shift+Tab to cycle into delegate mode.

148 

149### Talk to teammates directly141### Talk to teammates directly

150 142 

151Each teammate is a full, independent Claude Code session. You can message any teammate directly to give additional instructions, ask follow-up questions, or redirect their approach.143Each teammate is a full, independent Claude Code session. You can message any teammate directly to give additional instructions, ask follow-up questions, or redirect their approach.

152 144 

153* **In-process mode**: use Shift+Up/Down to select a teammate, then type to send them a message. Press Enter to view a teammate's session, then Escape to interrupt their current turn. Press Ctrl+T to toggle the task list.145* **In-process mode**: use Shift+Down to cycle through teammates, then type to send them a message. Press Enter to view a teammate's session, then Escape to interrupt their current turn. Press Ctrl+T to toggle the task list.

154* **Split-pane mode**: click into a teammate's pane to interact with their session directly. Each teammate has a full view of their own terminal.146* **Split-pane mode**: click into a teammate's pane to interact with their session directly. Each teammate has a full view of their own terminal.

155 147 

156### Assign and claim tasks148### Assign and claim tasks


349 341 

350### Teammates stopping on errors342### Teammates stopping on errors

351 343 

352Teammates may stop after encountering errors instead of recovering. Check their output using Shift+Up/Down in in-process mode or by clicking the pane in split mode, then either:344Teammates may stop after encountering errors instead of recovering. Check their output using Shift+Down in in-process mode or by clicking the pane in split mode, then either:

353 345 

354* Give them additional instructions directly346* Give them additional instructions directly

355* Spawn a replacement teammate to continue the work347* Spawn a replacement teammate to continue the work

Details

15* AWS CLI installed and configured (optional - only needed if you don't have another mechanism for getting credentials)15* AWS CLI installed and configured (optional - only needed if you don't have another mechanism for getting credentials)

16* Appropriate IAM permissions16* Appropriate IAM permissions

17 17 

18<Note>

19 If you are deploying Claude Code to multiple users, [pin your model versions](#4-pin-model-versions) to prevent breakage when Anthropic releases new models.

20</Note>

21 

18## Setup22## Setup

19 23 

20### 1. Submit use case details24### 1. Submit use case details


120* When using Bedrock, the `/login` and `/logout` commands are disabled since authentication is handled through AWS credentials.124* When using Bedrock, the `/login` and `/logout` commands are disabled since authentication is handled through AWS credentials.

121* You can use settings files for environment variables like `AWS_PROFILE` that you don't want to leak to other processes. See [Settings](/en/settings) for more information.125* You can use settings files for environment variables like `AWS_PROFILE` that you don't want to leak to other processes. See [Settings](/en/settings) for more information.

122 126 

123### 4. Model configuration127### 4. Pin model versions

128 

129<Warning>

130 Pin specific model versions for every deployment. If you use model aliases (`sonnet`, `opus`, `haiku`) without pinning, Claude Code may attempt to use a newer model version that isn't available in your Bedrock account, breaking existing users when Anthropic releases updates.

131</Warning>

132 

133Set these environment variables to specific Bedrock model IDs:

134 

135```bash theme={null}

136export ANTHROPIC_DEFAULT_OPUS_MODEL='us.anthropic.claude-opus-4-6-v1'

137export ANTHROPIC_DEFAULT_SONNET_MODEL='us.anthropic.claude-sonnet-4-6'

138export ANTHROPIC_DEFAULT_HAIKU_MODEL='us.anthropic.claude-haiku-4-5-20251001-v1:0'

139```

140 

141These variables use cross-region inference profile IDs (with the `us.` prefix). If you use a different region prefix or application inference profiles, adjust accordingly. For current and legacy model IDs, see [Models overview](https://platform.claude.com/docs/en/about-claude/models/overview). See [Model configuration](/en/model-config#pin-models-for-third-party-deployments) for the full list of environment variables.

124 142 

125Claude Code uses these default models for Bedrock:143Claude Code uses these default models when no pinning variables are set:

126 144 

127| Model type | Default value |145| Model type | Default value |

128| :--------------- | :-------------------------------------------- |146| :--------------- | :-------------------------------------------- |

129| Primary model | `global.anthropic.claude-sonnet-4-6` |147| Primary model | `global.anthropic.claude-sonnet-4-6` |

130| Small/fast model | `us.anthropic.claude-haiku-4-5-20251001-v1:0` |148| Small/fast model | `us.anthropic.claude-haiku-4-5-20251001-v1:0` |

131 149 

132<Note>150To customize models further, use one of these methods:

133 For Bedrock users, Claude Code won't automatically upgrade from Haiku 3.5 to Haiku 4.5. To manually switch to a newer Haiku model, set the `ANTHROPIC_DEFAULT_HAIKU_MODEL` environment variable to the full model name (for example, `us.anthropic.claude-haiku-4-5-20251001-v1:0`).

134</Note>

135 

136To customize models, use one of these methods:

137 151 

138```bash theme={null}152```bash theme={null}

139# Using inference profile ID153# Using inference profile ID


194For details, see [Bedrock IAM documentation](https://docs.aws.amazon.com/bedrock/latest/userguide/security-iam.html).208For details, see [Bedrock IAM documentation](https://docs.aws.amazon.com/bedrock/latest/userguide/security-iam.html).

195 209 

196<Note>210<Note>

197 We recommend creating a dedicated AWS account for Claude Code to simplify cost tracking and access control.211 Create a dedicated AWS account for Claude Code to simplify cost tracking and access control.

198</Note>212</Note>

199 213 

200## AWS Guardrails214## AWS Guardrails

Details

240 240 

241You can switch into Plan Mode during a session using **Shift+Tab** to cycle through permission modes.241You can switch into Plan Mode during a session using **Shift+Tab** to cycle through permission modes.

242 242 

243If you are in Normal Mode, **Shift+Tab** first switches into Auto-Accept Mode, indicated by `⏵⏵ accept edits on` at the bottom of the terminal. A subsequent **Shift+Tab** will switch into Plan Mode, indicated by `⏸ plan mode on`. When an [agent team](/en/agent-teams) is active, the cycle also includes Delegate Mode.243If you are in Normal Mode, **Shift+Tab** first switches into Auto-Accept Mode, indicated by `⏵⏵ accept edits on` at the bottom of the terminal. A subsequent **Shift+Tab** will switch into Plan Mode, indicated by `⏸ plan mode on`.

244 244 

245**Start a new session in Plan Mode**245**Start a new session in Plan Mode**

246 246 

desktop.md +3 −3

Details

53| **Plan** | `plan` | Claude analyzes your code and creates a plan without modifying files or running commands. Good for complex tasks where you want to review the approach first. |53| **Plan** | `plan` | Claude analyzes your code and creates a plan without modifying files or running commands. Good for complex tasks where you want to review the approach first. |

54| **Act** | `bypassPermissions` | Claude runs without any permission prompts, equivalent to `--dangerously-skip-permissions` in the CLI. Enable in your Settings → Claude Code under "Allow bypass permissions mode". Only use this in sandboxed containers or VMs. Enterprise admins can disable this option. |54| **Act** | `bypassPermissions` | Claude runs without any permission prompts, equivalent to `--dangerously-skip-permissions` in the CLI. Enable in your Settings → Claude Code under "Allow bypass permissions mode". Only use this in sandboxed containers or VMs. Enterprise admins can disable this option. |

55 55 

56The `delegate` and `dontAsk` permission modes are available only in the [CLI](/en/permissions#permission-modes).56The `dontAsk` permission mode is available only in the [CLI](/en/permissions#permission-modes).

57 57 

58<Tip title="Best practice">58<Tip title="Best practice">

59 Start complex tasks in Plan mode so Claude maps out an approach before making changes. Once you approve the plan, switch to Code or Ask mode to execute it. See [explore first, then plan, then code](/en/best-practices#explore-first-then-plan-then-code) for more on this workflow.59 Start complex tasks in Plan mode so Claude maps out an approach before making changes. Once you approve the plan, switch to Code or Ask mode to execute it. See [explore first, then plan, then code](/en/best-practices#explore-first-then-plan-then-code) for more on this workflow.


265 265 

266| Feature | CLI | Desktop |266| Feature | CLI | Desktop |

267| ----------------------------------------------------- | --------------------------------------------------------- | ------------------------------------------------------------ |267| ----------------------------------------------------- | --------------------------------------------------------- | ------------------------------------------------------------ |

268| Permission modes | all modes including `delegate` and `dontAsk` | Ask, Code, Plan, and Act via Settings |268| Permission modes | all modes including `dontAsk` | Ask, Code, Plan, and Act via Settings |

269| `--dangerously-skip-permissions` | CLI flag | Settings → Claude Code → "Allow bypass permissions mode" |269| `--dangerously-skip-permissions` | CLI flag | Settings → Claude Code → "Allow bypass permissions mode" |

270| [Third-party providers](/en/third-party-integrations) | Bedrock, Vertex, Foundry | not available. Desktop connects to Anthropic's API directly. |270| [Third-party providers](/en/third-party-integrations) | Bedrock, Vertex, Foundry | not available. Desktop connects to Anthropic's API directly. |

271| [MCP servers](/en/mcp) | configure in settings files | Connectors UI for local and SSH sessions, or settings files |271| [MCP servers](/en/mcp) | configure in settings files | Connectors UI for local and SSH sessions, or settings files |


281* **Third-party providers**: Desktop connects to Anthropic's API directly. Use the [CLI](/en/quickstart) with Bedrock, Vertex, or Foundry instead.281* **Third-party providers**: Desktop connects to Anthropic's API directly. Use the [CLI](/en/quickstart) with Bedrock, Vertex, or Foundry instead.

282* **Linux**: the desktop app is available on macOS and Windows only.282* **Linux**: the desktop app is available on macOS and Windows only.

283* **Inline code suggestions**: Desktop does not provide autocomplete-style suggestions. It works through conversational prompts and explicit code changes.283* **Inline code suggestions**: Desktop does not provide autocomplete-style suggestions. It works through conversational prompts and explicit code changes.

284* **Agent teams and `delegate` mode**: multi-agent orchestration and the `delegate` permission mode are available via the [CLI](/en/agent-teams) and [Agent SDK](/en/headless), not in Desktop.284* **Agent teams**: multi-agent orchestration is available via the [CLI](/en/agent-teams) and [Agent SDK](/en/headless), not in Desktop.

285 285 

286## Troubleshooting286## Troubleshooting

287 287 

Details

16* Google Cloud SDK (`gcloud`) installed and configured16* Google Cloud SDK (`gcloud`) installed and configured

17* Quota allocated in desired GCP region17* Quota allocated in desired GCP region

18 18 

19<Note>

20 If you are deploying Claude Code to multiple users, [pin your model versions](#5-pin-model-versions) to prevent breakage when Anthropic releases new models.

21</Note>

22 

19## Region Configuration23## Region Configuration

20 24 

21Claude Code can be used with both Vertex AI [global](https://cloud.google.com/blog/products/ai-machine-learning/global-endpoint-for-claude-models-generally-available-on-vertex-ai) and regional endpoints.25Claude Code can be used with both Vertex AI [global](https://cloud.google.com/blog/products/ai-machine-learning/global-endpoint-for-claude-models-generally-available-on-vertex-ai) and regional endpoints.

22 26 

23<Note>27<Note>

24 Vertex AI may not support the Claude Code default models on all regions. You may need to switch to a [supported region or model](https://cloud.google.com/vertex-ai/generative-ai/docs/learn/locations#genai-partner-models).28 Vertex AI may not support the Claude Code default models in all [regions](https://cloud.google.com/vertex-ai/generative-ai/docs/learn/locations#genai-partner-models) or on [global endpoints](https://cloud.google.com/vertex-ai/generative-ai/docs/partner-models/use-partner-models#supported_models). You may need to switch to a supported region, use a regional endpoint, or specify a supported model.

25</Note>

26 

27<Note>

28 Vertex AI may not support the Claude Code default models on global endpoints. You may need to switch to a regional endpoint or [supported model](https://cloud.google.com/vertex-ai/generative-ai/docs/partner-models/use-partner-models#supported_models).

29</Note>29</Note>

30 30 

31## Setup31## Setup


85export VERTEX_REGION_CLAUDE_4_1_OPUS=europe-west185export VERTEX_REGION_CLAUDE_4_1_OPUS=europe-west1

86```86```

87 87 

88<Note>88[Prompt caching](https://platform.claude.com/docs/en/build-with-claude/prompt-caching) is automatically supported when you specify the `cache_control` ephemeral flag. To disable it, set `DISABLE_PROMPT_CACHING=1`. For heightened rate limits, contact Google Cloud support. When using Vertex AI, the `/login` and `/logout` commands are disabled since authentication is handled through Google Cloud credentials.

89 [Prompt caching](https://platform.claude.com/docs/en/build-with-claude/prompt-caching) is automatically supported when you specify the `cache_control` ephemeral flag. To disable it, set `DISABLE_PROMPT_CACHING=1`. For heightened rate limits, contact Google Cloud support.

90</Note>

91 89 

92<Note>90### 5. Pin model versions

93 When using Vertex AI, the `/login` and `/logout` commands are disabled since authentication is handled through Google Cloud credentials.91 

94</Note>92<Warning>

93 Pin specific model versions for every deployment. If you use model aliases (`sonnet`, `opus`, `haiku`) without pinning, Claude Code may attempt to use a newer model version that isn't enabled in your Vertex AI project, breaking existing users when Anthropic releases updates.

94</Warning>

95 

96Set these environment variables to specific Vertex AI model IDs:

95 97 

96### 5. Model configuration98```bash theme={null}

99export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-6'

100export ANTHROPIC_DEFAULT_SONNET_MODEL='claude-sonnet-4-6'

101export ANTHROPIC_DEFAULT_HAIKU_MODEL='claude-haiku-4-5@20251001'

102```

97 103 

98Claude Code uses these default models for Vertex AI:104For current and legacy model IDs, see [Models overview](https://platform.claude.com/docs/en/about-claude/models/overview). See [Model configuration](/en/model-config#pin-models-for-third-party-deployments) for the full list of environment variables.

105 

106Claude Code uses these default models when no pinning variables are set:

99 107 

100| Model type | Default value |108| Model type | Default value |

101| :--------------- | :-------------------------- |109| :--------------- | :-------------------------- |

102| Primary model | `claude-sonnet-4-6` |110| Primary model | `claude-sonnet-4-6` |

103| Small/fast model | `claude-haiku-4-5@20251001` |111| Small/fast model | `claude-haiku-4-5@20251001` |

104 112 

105<Note>113To customize models further:

106 For Vertex AI users, Claude Code will not automatically upgrade from Haiku 3.5 to Haiku 4.5. To manually switch to a newer Haiku model, set the `ANTHROPIC_DEFAULT_HAIKU_MODEL` environment variable to the full model name (for example, `claude-haiku-4-5@20251001`).

107</Note>

108 

109To customize models:

110 114 

111```bash theme={null}115```bash theme={null}

112export ANTHROPIC_MODEL='claude-opus-4-6'116export ANTHROPIC_MODEL='claude-opus-4-6'


126For details, see [Vertex IAM documentation](https://cloud.google.com/vertex-ai/docs/general/access-control).130For details, see [Vertex IAM documentation](https://cloud.google.com/vertex-ai/docs/general/access-control).

127 131 

128<Note>132<Note>

129 We recommend creating a dedicated GCP project for Claude Code to simplify cost tracking and access control.133 Create a dedicated GCP project for Claude Code to simplify cost tracking and access control.

130</Note>134</Note>

131 135 

132## 1M token context window136## 1M token context window

hooks.md +6 −4

Details

1085 1085 

1086#### SubagentStop input1086#### SubagentStop input

1087 1087 

1088In addition to the [common input fields](#common-input-fields), SubagentStop hooks receive `stop_hook_active`, `agent_id`, `agent_type`, and `agent_transcript_path`. The `agent_type` field is the value used for matcher filtering. The `transcript_path` is the main session's transcript, while `agent_transcript_path` is the subagent's own transcript stored in a nested `subagents/` folder.1088In addition to the [common input fields](#common-input-fields), SubagentStop hooks receive `stop_hook_active`, `agent_id`, `agent_type`, `agent_transcript_path`, and `last_assistant_message`. The `agent_type` field is the value used for matcher filtering. The `transcript_path` is the main session's transcript, while `agent_transcript_path` is the subagent's own transcript stored in a nested `subagents/` folder. The `last_assistant_message` field contains the text content of the subagent's final response, so hooks can access it without parsing the transcript file.

1089 1089 

1090```json theme={null}1090```json theme={null}

1091{1091{


1097 "stop_hook_active": false,1097 "stop_hook_active": false,

1098 "agent_id": "def456",1098 "agent_id": "def456",

1099 "agent_type": "Explore",1099 "agent_type": "Explore",

1100 "agent_transcript_path": "~/.claude/projects/.../abc123/subagents/agent-def456.jsonl"1100 "agent_transcript_path": "~/.claude/projects/.../abc123/subagents/agent-def456.jsonl",

1101 "last_assistant_message": "Analysis complete. Found 3 potential issues..."

1101}1102}

1102```1103```

1103 1104 


1110 1111 

1111#### Stop input1112#### Stop input

1112 1113 

1113In addition to the [common input fields](#common-input-fields), Stop hooks receive `stop_hook_active`. This field is `true` when Claude Code is already continuing as a result of a stop hook. Check this value or process the transcript to prevent Claude Code from running indefinitely.1114In addition to the [common input fields](#common-input-fields), Stop hooks receive `stop_hook_active` and `last_assistant_message`. The `stop_hook_active` field is `true` when Claude Code is already continuing as a result of a stop hook. Check this value or process the transcript to prevent Claude Code from running indefinitely. The `last_assistant_message` field contains the text content of Claude's final response, so hooks can access it without parsing the transcript file.

1114 1115 

1115```json theme={null}1116```json theme={null}

1116{1117{


1119 "cwd": "/Users/...",1120 "cwd": "/Users/...",

1120 "permission_mode": "default",1121 "permission_mode": "default",

1121 "hook_event_name": "Stop",1122 "hook_event_name": "Stop",

1122 "stop_hook_active": true1123 "stop_hook_active": true,

1124 "last_assistant_message": "I've completed the refactoring. Here's a summary..."

1123}1125}

1124```1126```

1125 1127 

Details

142* **Default**: Claude asks before file edits and shell commands142* **Default**: Claude asks before file edits and shell commands

143* **Auto-accept edits**: Claude edits files without asking, still asks for commands143* **Auto-accept edits**: Claude edits files without asking, still asks for commands

144* **Plan mode**: Claude uses read-only tools only, creating a plan you can approve before execution144* **Plan mode**: Claude uses read-only tools only, creating a plan you can approve before execution

145* **Delegate mode**: Claude coordinates work through [agent teammates](/en/agent-teams) only, with no direct implementation. Only available when an agent team is active.

146 145 

147You can also allow specific commands in `.claude/settings.json` so Claude doesn't ask each time. This is useful for trusted commands like `npm test` or `git status`. Settings can be scoped from organization-wide policies down to personal preferences. See [Permissions](/en/permissions) for details.146You can also allow specific commands in `.claude/settings.json` so Claude doesn't ask each time. This is useful for trusted commands like `npm test` or `git status`. Settings can be scoped from organization-wide policies down to personal preferences. See [Permissions](/en/permissions) for details.

148 147 

Details

23### General controls23### General controls

24 24 

25| Shortcut | Description | Context |25| Shortcut | Description | Context |

26| :------------------------------------------------ | :--------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------- |26| :------------------------------------------------ | :--------------------------------- | :-------------------------------------------------------------------------------------------- |

27| `Ctrl+C` | Cancel current input or generation | Standard interrupt |27| `Ctrl+C` | Cancel current input or generation | Standard interrupt |

28| `Ctrl+D` | Exit Claude Code session | EOF signal |28| `Ctrl+D` | Exit Claude Code session | EOF signal |

29| `Ctrl+G` | Open in default text editor | Edit your prompt or custom response in your default text editor |29| `Ctrl+G` | Open in default text editor | Edit your prompt or custom response in your default text editor |


36| `Left/Right arrows` | Cycle through dialog tabs | Navigate between tabs in permission dialogs and menus |36| `Left/Right arrows` | Cycle through dialog tabs | Navigate between tabs in permission dialogs and menus |

37| `Up/Down arrows` | Navigate command history | Recall previous inputs |37| `Up/Down arrows` | Navigate command history | Recall previous inputs |

38| `Esc` + `Esc` | Rewind or summarize | Restore code and/or conversation to a previous point, or summarize from a selected message |38| `Esc` + `Esc` | Rewind or summarize | Restore code and/or conversation to a previous point, or summarize from a selected message |

39| `Shift+Tab` or `Alt+M` (some configurations) | Toggle permission modes | Switch between Auto-Accept Mode, Plan Mode, and normal mode. When an [agent team](/en/agent-teams) is active, the cycle also includes Delegate Mode. |39| `Shift+Tab` or `Alt+M` (some configurations) | Toggle permission modes | Switch between Auto-Accept Mode, Plan Mode, and normal mode. |

40| `Option+P` (macOS) or `Alt+P` (Windows/Linux) | Switch model | Switch models without clearing your prompt |40| `Option+P` (macOS) or `Alt+P` (Windows/Linux) | Switch model | Switch models without clearing your prompt |

41| `Option+T` (macOS) or `Alt+T` (Windows/Linux) | Toggle extended thinking | Enable or disable extended thinking mode. Run `/terminal-setup` first to enable this shortcut |41| `Option+T` (macOS) or `Alt+T` (Windows/Linux) | Toggle extended thinking | Enable or disable extended thinking mode. Run `/terminal-setup` first to enable this shortcut |

42 42 

Details

14* RBAC permissions to create Microsoft Foundry resources and deployments14* RBAC permissions to create Microsoft Foundry resources and deployments

15* Azure CLI installed and configured (optional - only needed if you don't have another mechanism for getting credentials)15* Azure CLI installed and configured (optional - only needed if you don't have another mechanism for getting credentials)

16 16 

17<Note>

18 If you are deploying Claude Code to multiple users, [pin your model versions](#4-pin-model-versions) to prevent breakage when Anthropic releases new models.

19</Note>

20 

17## Setup21## Setup

18 22 

19### 1. Provision Microsoft Foundry resource23### 1. Provision Microsoft Foundry resource


59 63 

60### 3. Configure Claude Code64### 3. Configure Claude Code

61 65 

62Set the following environment variables to enable Microsoft Foundry. Note that your deployments' names are set as the model identifiers in Claude Code (may be optional if using suggested deployment names).66Set the following environment variables to enable Microsoft Foundry:

63 67 

64```bash theme={null}68```bash theme={null}

65# Enable Microsoft Foundry integration69# Enable Microsoft Foundry integration


69export ANTHROPIC_FOUNDRY_RESOURCE={resource}73export ANTHROPIC_FOUNDRY_RESOURCE={resource}

70# Or provide the full base URL:74# Or provide the full base URL:

71# export ANTHROPIC_FOUNDRY_BASE_URL=https://{resource}.services.ai.azure.com/anthropic75# export ANTHROPIC_FOUNDRY_BASE_URL=https://{resource}.services.ai.azure.com/anthropic

76```

77 

78### 4. Pin model versions

72 79 

73# Set models to your resource's deployment names80<Warning>

81 Pin specific model versions for every deployment. If you use model aliases (`sonnet`, `opus`, `haiku`) without pinning, Claude Code may attempt to use a newer model version that isn't available in your Foundry account, breaking existing users when Anthropic releases updates. When you create Azure deployments, select a specific model version rather than "auto-update to latest."

82</Warning>

83 

84Set the model variables to match the deployment names you created in step 1:

85 

86```bash theme={null}

87export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-6'

74export ANTHROPIC_DEFAULT_SONNET_MODEL='claude-sonnet-4-6'88export ANTHROPIC_DEFAULT_SONNET_MODEL='claude-sonnet-4-6'

75export ANTHROPIC_DEFAULT_HAIKU_MODEL='claude-haiku-4-5'89export ANTHROPIC_DEFAULT_HAIKU_MODEL='claude-haiku-4-5'

76export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-6'

77```90```

78 91 

79For more details on model configuration options, see [Model configuration](/en/model-config).92For current and legacy model IDs, see [Models overview](https://platform.claude.com/docs/en/about-claude/models/overview). See [Model configuration](/en/model-config#pin-models-for-third-party-deployments) for the full list of environment variables.

80 93 

81## Azure RBAC configuration94## Azure RBAC configuration

82 95 

model-config.md +37 −7

Details

145 145 

146Effort is currently supported on Opus 4.6. The effort slider appears in `/model` when a supported model is selected.146Effort is currently supported on Opus 4.6. The effort slider appears in `/model` when a supported model is selected.

147 147 

148### Extended context with \[1m]148### Extended context

149 149 

150The `[1m]` suffix enables a [1 million token context window](https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window) for long sessions.150Opus 4.6 and Sonnet 4.6 support a [1 million token context window](https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window) for long sessions with large codebases.

151 151 

152<Note>152<Note>

153 For Opus 4.6, the 1M context window is available for API and Claude Code pay-as-you-go users. Pro, Max, Teams, and Enterprise subscription users do not have access to Opus 4.6 1M context at launch.153 The 1M context window is currently in beta. Features, pricing, and availability may change.

154</Note>154</Note>

155 155 

156You can use the `[1m]` suffix with model aliases or full model names:156Extended context is available for:

157 

158* **API and pay-as-you-go users**: full access to 1M context

159* **Pro, Max, Teams, and Enterprise subscribers**: available with [extra usage](https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans) enabled

160 

161Selecting a 1M model does not immediately change billing. Your session uses standard rates until it exceeds 200K tokens of context. Beyond 200K tokens, requests are charged at [long-context pricing](https://platform.claude.com/docs/en/about-claude/pricing#long-context-pricing) with dedicated [rate limits](https://platform.claude.com/docs/en/api/rate-limits#long-context-rate-limits). For subscribers, tokens beyond 200K are billed as extra usage rather than through the subscription.

162 

163If your account supports 1M context, the option appears in the model picker (`/model`) in the latest versions of Claude Code. If you don't see it, try restarting your session.

164 

165You can also use the `[1m]` suffix with model aliases or full model names:

157 166 

158```bash theme={null}167```bash theme={null}

159# Use the sonnet[1m] alias168# Use the sonnet[1m] alias


163/model claude-sonnet-4-6[1m]172/model claude-sonnet-4-6[1m]

164```173```

165 174 

166Note: Extended context models have

167[different pricing](https://platform.claude.com/docs/en/about-claude/pricing#long-context-pricing).

168 

169## Checking your current model175## Checking your current model

170 176 

171You can see which model you're currently using in several ways:177You can see which model you're currently using in several ways:


188Note: `ANTHROPIC_SMALL_FAST_MODEL` is deprecated in favor of194Note: `ANTHROPIC_SMALL_FAST_MODEL` is deprecated in favor of

189`ANTHROPIC_DEFAULT_HAIKU_MODEL`.195`ANTHROPIC_DEFAULT_HAIKU_MODEL`.

190 196 

197### Pin models for third-party deployments

198 

199When deploying Claude Code through [Bedrock](/en/amazon-bedrock), [Vertex AI](/en/google-vertex-ai), or [Foundry](/en/microsoft-foundry), pin model versions before rolling out to users.

200 

201Without pinning, Claude Code uses model aliases (`sonnet`, `opus`, `haiku`) that resolve to the latest version. When Anthropic releases a new model, users whose accounts don't have the new version enabled will break silently.

202 

203<Warning>

204 Set all three model environment variables to specific version IDs as part of your initial setup. Skipping this step means a Claude Code update can break your users without any action on your part.

205</Warning>

206 

207Use the following environment variables with version-specific model IDs for your provider:

208 

209| Provider | Example |

210| :-------- | :---------------------------------------------------------------------- |

211| Bedrock | `export ANTHROPIC_DEFAULT_OPUS_MODEL='us.anthropic.claude-opus-4-6-v1'` |

212| Vertex AI | `export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-6'` |

213| Foundry | `export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-6'` |

214 

215Apply the same pattern for `ANTHROPIC_DEFAULT_SONNET_MODEL` and `ANTHROPIC_DEFAULT_HAIKU_MODEL`. For current and legacy model IDs across all providers, see [Models overview](https://platform.claude.com/docs/en/about-claude/models/overview). To upgrade users to a new model version, update these environment variables and redeploy.

216 

217<Note>

218 The `settings.availableModels` allowlist still applies when using third-party providers. Filtering matches on the model alias (`opus`, `sonnet`, `haiku`), not the provider-specific model ID.

219</Note>

220 

191### Prompt caching configuration221### Prompt caching configuration

192 222 

193Claude Code automatically uses [prompt caching](https://platform.claude.com/docs/en/build-with-claude/prompt-caching) to optimize performance and reduce costs. You can disable prompt caching globally or for specific model tiers:223Claude Code automatically uses [prompt caching](https://platform.claude.com/docs/en/build-with-claude/prompt-caching) to optimize performance and reduce costs. You can disable prompt caching globally or for specific model tiers:

Details

6 6 

7> Learn how to enable and configure OpenTelemetry for Claude Code.7> Learn how to enable and configure OpenTelemetry for Claude Code.

8 8 

9Claude Code supports OpenTelemetry (OTel) metrics and events for monitoring and observability.9Track Claude Code usage, costs, and tool activity across your organization by exporting telemetry data through OpenTelemetry (OTel). Claude Code exports metrics as time series data via the standard metrics protocol, and events via the logs/events protocol. Configure your metrics and logs backends to match your monitoring requirements.

10 

11All metrics are time series data exported via OpenTelemetry's standard metrics protocol, and events are exported via OpenTelemetry's logs/events protocol. It is the user's responsibility to ensure their metrics and logs backends are properly configured and that the aggregation granularity meets their monitoring requirements.

12 10 

13## Quick start11## Quick start

14 12 


56 "OTEL_METRICS_EXPORTER": "otlp",54 "OTEL_METRICS_EXPORTER": "otlp",

57 "OTEL_LOGS_EXPORTER": "otlp",55 "OTEL_LOGS_EXPORTER": "otlp",

58 "OTEL_EXPORTER_OTLP_PROTOCOL": "grpc",56 "OTEL_EXPORTER_OTLP_PROTOCOL": "grpc",

59 "OTEL_EXPORTER_OTLP_ENDPOINT": "http://collector.company.com:4317",57 "OTEL_EXPORTER_OTLP_ENDPOINT": "http://collector.example.com:4317",

60 "OTEL_EXPORTER_OTLP_HEADERS": "Authorization=Bearer company-token"58 "OTEL_EXPORTER_OTLP_HEADERS": "Authorization=Bearer example-token"

61 }59 }

62}60}

63```61```


71### Common configuration variables69### Common configuration variables

72 70 

73| Environment Variable | Description | Example Values |71| Environment Variable | Description | Example Values |

74| ----------------------------------------------- | ------------------------------------------------------------------------------------------ | ------------------------------------ |72| --------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | ------------------------------------ |

75| `CLAUDE_CODE_ENABLE_TELEMETRY` | Enables telemetry collection (required) | `1` |73| `CLAUDE_CODE_ENABLE_TELEMETRY` | Enables telemetry collection (required) | `1` |

76| `OTEL_METRICS_EXPORTER` | Metrics exporter type(s) (comma-separated) | `console`, `otlp`, `prometheus` |74| `OTEL_METRICS_EXPORTER` | Metrics exporter types, comma-separated | `console`, `otlp`, `prometheus` |

77| `OTEL_LOGS_EXPORTER` | Logs/events exporter type(s) (comma-separated) | `console`, `otlp` |75| `OTEL_LOGS_EXPORTER` | Logs/events exporter types, comma-separated | `console`, `otlp` |

78| `OTEL_EXPORTER_OTLP_PROTOCOL` | Protocol for OTLP exporter (all signals) | `grpc`, `http/json`, `http/protobuf` |76| `OTEL_EXPORTER_OTLP_PROTOCOL` | Protocol for OTLP exporter, applies to all signals | `grpc`, `http/json`, `http/protobuf` |

79| `OTEL_EXPORTER_OTLP_ENDPOINT` | OTLP collector endpoint (all signals) | `http://localhost:4317` |77| `OTEL_EXPORTER_OTLP_ENDPOINT` | OTLP collector endpoint for all signals | `http://localhost:4317` |

80| `OTEL_EXPORTER_OTLP_METRICS_PROTOCOL` | Protocol for metrics (overrides general) | `grpc`, `http/json`, `http/protobuf` |78| `OTEL_EXPORTER_OTLP_METRICS_PROTOCOL` | Protocol for metrics, overrides general setting | `grpc`, `http/json`, `http/protobuf` |

81| `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT` | OTLP metrics endpoint (overrides general) | `http://localhost:4318/v1/metrics` |79| `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT` | OTLP metrics endpoint, overrides general setting | `http://localhost:4318/v1/metrics` |

82| `OTEL_EXPORTER_OTLP_LOGS_PROTOCOL` | Protocol for logs (overrides general) | `grpc`, `http/json`, `http/protobuf` |80| `OTEL_EXPORTER_OTLP_LOGS_PROTOCOL` | Protocol for logs, overrides general setting | `grpc`, `http/json`, `http/protobuf` |

83| `OTEL_EXPORTER_OTLP_LOGS_ENDPOINT` | OTLP logs endpoint (overrides general) | `http://localhost:4318/v1/logs` |81| `OTEL_EXPORTER_OTLP_LOGS_ENDPOINT` | OTLP logs endpoint, overrides general setting | `http://localhost:4318/v1/logs` |

84| `OTEL_EXPORTER_OTLP_HEADERS` | Authentication headers for OTLP | `Authorization=Bearer token` |82| `OTEL_EXPORTER_OTLP_HEADERS` | Authentication headers for OTLP | `Authorization=Bearer token` |

85| `OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY` | Client key for mTLS authentication | Path to client key file |83| `OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY` | Client key for mTLS authentication | Path to client key file |

86| `OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE` | Client certificate for mTLS authentication | Path to client cert file |84| `OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE` | Client certificate for mTLS authentication | Path to client cert file |


88| `OTEL_LOGS_EXPORT_INTERVAL` | Logs export interval in milliseconds (default: 5000) | `1000`, `10000` |86| `OTEL_LOGS_EXPORT_INTERVAL` | Logs export interval in milliseconds (default: 5000) | `1000`, `10000` |

89| `OTEL_LOG_USER_PROMPTS` | Enable logging of user prompt content (default: disabled) | `1` to enable |87| `OTEL_LOG_USER_PROMPTS` | Enable logging of user prompt content (default: disabled) | `1` to enable |

90| `OTEL_LOG_TOOL_DETAILS` | Enable logging of MCP server/tool names and skill names in tool events (default: disabled) | `1` to enable |88| `OTEL_LOG_TOOL_DETAILS` | Enable logging of MCP server/tool names and skill names in tool events (default: disabled) | `1` to enable |

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

91| `CLAUDE_CODE_OTEL_HEADERS_HELPER_DEBOUNCE_MS` | Interval for refreshing dynamic headers (default: 1740000ms / 29 minutes) | `900000` |90| `CLAUDE_CODE_OTEL_HEADERS_HELPER_DEBOUNCE_MS` | Interval for refreshing dynamic headers (default: 1740000ms / 29 minutes) | `900000` |

92 91 

93### Metrics cardinality control92### Metrics cardinality control


149<Warning>148<Warning>

150 **Important formatting requirements for OTEL\_RESOURCE\_ATTRIBUTES:**149 **Important formatting requirements for OTEL\_RESOURCE\_ATTRIBUTES:**

151 150 

152 The `OTEL_RESOURCE_ATTRIBUTES` environment variable follows the [W3C Baggage specification](https://www.w3.org/TR/baggage/), which has strict formatting requirements:151 The `OTEL_RESOURCE_ATTRIBUTES` environment variable uses comma-separated key=value pairs with strict formatting requirements:

153 152 

154 * **No spaces allowed**: Values cannot contain spaces. For example, `user.organizationName=My Company` is invalid153 * **No spaces allowed**: Values cannot contain spaces. For example, `user.organizationName=My Company` is invalid

155 * **Format**: Must be comma-separated key=value pairs: `key1=value1,key2=value2`154 * **Format**: Must be comma-separated key=value pairs: `key1=value1,key2=value2`


175 174 

176### Example configurations175### Example configurations

177 176 

177Set these environment variables before running `claude`. Each block shows a complete configuration for a different exporter or deployment scenario:

178 

178```bash theme={null}179```bash theme={null}

179# Console debugging (1-second intervals)180# Console debugging (1-second intervals)

180export CLAUDE_CODE_ENABLE_TELEMETRY=1181export CLAUDE_CODE_ENABLE_TELEMETRY=1


201export OTEL_METRICS_EXPORTER=otlp202export OTEL_METRICS_EXPORTER=otlp

202export OTEL_LOGS_EXPORTER=otlp203export OTEL_LOGS_EXPORTER=otlp

203export OTEL_EXPORTER_OTLP_METRICS_PROTOCOL=http/protobuf204export OTEL_EXPORTER_OTLP_METRICS_PROTOCOL=http/protobuf

204export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=http://metrics.company.com:4318205export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=http://metrics.example.com:4318

205export OTEL_EXPORTER_OTLP_LOGS_PROTOCOL=grpc206export OTEL_EXPORTER_OTLP_LOGS_PROTOCOL=grpc

206export OTEL_EXPORTER_OTLP_LOGS_ENDPOINT=http://logs.company.com:4317207export OTEL_EXPORTER_OTLP_LOGS_ENDPOINT=http://logs.example.com:4317

207 208 

208# Metrics only (no events/logs)209# Metrics only (no events/logs)

209export CLAUDE_CODE_ENABLE_TELEMETRY=1210export CLAUDE_CODE_ENABLE_TELEMETRY=1


225All metrics and events share these standard attributes:226All metrics and events share these standard attributes:

226 227 

227| Attribute | Description | Controlled By |228| Attribute | Description | Controlled By |

228| ------------------- | -------------------------------------------------------------------- | --------------------------------------------------- |229| ------------------- | -------------------------------------------------------------------------------- | --------------------------------------------------- |

229| `session.id` | Unique session identifier | `OTEL_METRICS_INCLUDE_SESSION_ID` (default: true) |230| `session.id` | Unique session identifier | `OTEL_METRICS_INCLUDE_SESSION_ID` (default: true) |

230| `app.version` | Current Claude Code version | `OTEL_METRICS_INCLUDE_VERSION` (default: false) |231| `app.version` | Current Claude Code version | `OTEL_METRICS_INCLUDE_VERSION` (default: false) |

231| `organization.id` | Organization UUID (when authenticated) | Always included when available |232| `organization.id` | Organization UUID (when authenticated) | Always included when available |

232| `user.account_uuid` | Account UUID (when authenticated) | `OTEL_METRICS_INCLUDE_ACCOUNT_UUID` (default: true) |233| `user.account_uuid` | Account UUID (when authenticated) | `OTEL_METRICS_INCLUDE_ACCOUNT_UUID` (default: true) |

233| `terminal.type` | Terminal type (for example, `iTerm.app`, `vscode`, `cursor`, `tmux`) | Always included when detected |234| `user.id` | Anonymous device/installation identifier, generated per Claude Code installation | Always included |

235| `user.email` | User email address (when authenticated via OAuth) | Always included when available |

236| `terminal.type` | Terminal type, such as `iTerm.app`, `vscode`, `cursor`, or `tmux` | Always included when detected |

234 237 

235### Metrics238### Metrics

236 239 


249 252 

250### Metric details253### Metric details

251 254 

255Each metric includes the standard attributes listed above. Metrics with additional context-specific attributes are noted below.

256 

252#### Session counter257#### Session counter

253 258 

254Incremented at the start of each session.259Incremented at the start of each session.


308**Attributes**:313**Attributes**:

309 314 

310* All [standard attributes](#standard-attributes)315* All [standard attributes](#standard-attributes)

311* `tool`: Tool name (`"Edit"`, `"Write"`, `"NotebookEdit"`)316* `tool_name`: Tool name (`"Edit"`, `"Write"`, `"NotebookEdit"`)

312* `decision`: User decision (`"accept"`, `"reject"`)317* `decision`: User decision (`"accept"`, `"reject"`)

313* `language`: Programming language of the edited file (for example, `"TypeScript"`, `"Python"`, `"JavaScript"`, `"Markdown"`). Returns `"unknown"` for unrecognized file extensions.318* `source`: Decision source - `"config"`, `"hook"`, `"user_permanent"`, `"user_temporary"`, `"user_abort"`, or `"user_reject"`

319* `language`: Programming language of the edited file, such as `"TypeScript"`, `"Python"`, `"JavaScript"`, or `"Markdown"`. Returns `"unknown"` for unrecognized file extensions.

314 320 

315#### Active time counter321#### Active time counter

316 322 

317Tracks actual time spent actively using Claude Code (not idle time). This metric is incremented during user interactions such as typing prompts or receiving responses.323Tracks actual time spent actively using Claude Code, excluding idle time. This metric is incremented during user interactions (typing, reading responses) and during CLI processing (tool execution, AI response generation).

318 324 

319**Attributes**:325**Attributes**:

320 326 

321* All [standard attributes](#standard-attributes)327* All [standard attributes](#standard-attributes)

328* `type`: `"user"` for keyboard interactions, `"cli"` for tool execution and AI responses

322 329 

323### Events330### Events

324 331 

325Claude Code exports the following events via OpenTelemetry logs/events (when `OTEL_LOGS_EXPORTER` is configured):332Claude Code exports the following events via OpenTelemetry logs/events (when `OTEL_LOGS_EXPORTER` is configured):

326 333 

334#### Event correlation attributes

335 

336When a user submits a prompt, Claude Code may make multiple API calls and run several tools. The `prompt.id` attribute lets you tie all of those events back to the single prompt that triggered them.

337 

338| Attribute | Description |

339| ----------- | ------------------------------------------------------------------------------------ |

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

341 

342To trace all activity triggered by a single prompt, filter your events by a specific `prompt.id` value. This returns the user\_prompt event, any api\_request events, and any tool\_result events that occurred while processing that prompt.

343 

344<Note>

345 `prompt.id` is intentionally excluded from metrics because each prompt generates a unique ID, which would create an ever-growing number of time series. Use it for event-level analysis and audit trails only.

346</Note>

347 

327#### User prompt event348#### User prompt event

328 349 

329Logged when a user submits a prompt.350Logged when a user submits a prompt.


355* `success`: `"true"` or `"false"`376* `success`: `"true"` or `"false"`

356* `duration_ms`: Execution time in milliseconds377* `duration_ms`: Execution time in milliseconds

357* `error`: Error message (if failed)378* `error`: Error message (if failed)

358* `decision`: Either `"accept"` or `"reject"`379* `decision_type`: Either `"accept"` or `"reject"`

359* `source`: Decision source - `"config"`, `"user_permanent"`, `"user_temporary"`, `"user_abort"`, or `"user_reject"`380* `decision_source`: Decision source - `"config"`, `"hook"`, `"user_permanent"`, `"user_temporary"`, `"user_abort"`, or `"user_reject"`

381* `tool_result_size_bytes`: Size of the tool result in bytes

382* `mcp_server_scope`: MCP server scope identifier (for MCP tools)

360* `tool_parameters`: JSON string containing tool-specific parameters (when available)383* `tool_parameters`: JSON string containing tool-specific parameters (when available)

361 * For Bash tool: includes `bash_command`, `full_command`, `timeout`, `description`, `sandbox`384 * For Bash tool: includes `bash_command`, `full_command`, `timeout`, `description`, `dangerouslyDisableSandbox`, and `git_commit_id` (the commit SHA, when a `git commit` command succeeds)

362 * For MCP tools (when `OTEL_LOG_TOOL_DETAILS=1`): includes `mcp_server_name`, `mcp_tool_name`385 * For MCP tools (when `OTEL_LOG_TOOL_DETAILS=1`): includes `mcp_server_name`, `mcp_tool_name`

363 * For Skill tool (when `OTEL_LOG_TOOL_DETAILS=1`): includes `skill_name`386 * For Skill tool (when `OTEL_LOG_TOOL_DETAILS=1`): includes `skill_name`

364 387 


381* `output_tokens`: Number of output tokens404* `output_tokens`: Number of output tokens

382* `cache_read_tokens`: Number of tokens read from cache405* `cache_read_tokens`: Number of tokens read from cache

383* `cache_creation_tokens`: Number of tokens used for cache creation406* `cache_creation_tokens`: Number of tokens used for cache creation

407* `speed`: `"fast"` or `"normal"`, indicating whether fast mode was active

384 408 

385#### API error event409#### API error event

386 410 


396* `event.sequence`: monotonically increasing counter for ordering events within a session420* `event.sequence`: monotonically increasing counter for ordering events within a session

397* `model`: Model used (for example, "claude-sonnet-4-6")421* `model`: Model used (for example, "claude-sonnet-4-6")

398* `error`: Error message422* `error`: Error message

399* `status_code`: HTTP status code (if applicable)423* `status_code`: HTTP status code as a string, or `"undefined"` for non-HTTP errors

400* `duration_ms`: Request duration in milliseconds424* `duration_ms`: Request duration in milliseconds

401* `attempt`: Attempt number (for retried requests)425* `attempt`: Attempt number (for retried requests)

426* `speed`: `"fast"` or `"normal"`, indicating whether fast mode was active

402 427 

403#### Tool decision event428#### Tool decision event

404 429 


414* `event.sequence`: monotonically increasing counter for ordering events within a session439* `event.sequence`: monotonically increasing counter for ordering events within a session

415* `tool_name`: Name of the tool (for example, "Read", "Edit", "Write", "NotebookEdit")440* `tool_name`: Name of the tool (for example, "Read", "Edit", "Write", "NotebookEdit")

416* `decision`: Either `"accept"` or `"reject"`441* `decision`: Either `"accept"` or `"reject"`

417* `source`: Decision source - `"config"`, `"user_permanent"`, `"user_temporary"`, `"user_abort"`, or `"user_reject"`442* `source`: Decision source - `"config"`, `"hook"`, `"user_permanent"`, `"user_temporary"`, `"user_abort"`, or `"user_reject"`

418 443 

419## Interpreting metrics and events data444## Interpret metrics and events data

420 445 

421The metrics exported by Claude Code provide valuable insights into usage patterns and productivity. Here are some common visualizations and analyses you can create:446The exported metrics and events support a range of analyses:

422 447 

423### Usage monitoring448### Usage monitoring

424 449 


497 522 

498For a comprehensive guide on measuring return on investment for Claude Code, including telemetry setup, cost analysis, productivity metrics, and automated reporting, see the [Claude Code ROI Measurement Guide](https://github.com/anthropics/claude-code-monitoring-guide). This repository provides ready-to-use Docker Compose configurations, Prometheus and OpenTelemetry setups, and templates for generating productivity reports integrated with tools like Linear.523For a comprehensive guide on measuring return on investment for Claude Code, including telemetry setup, cost analysis, productivity metrics, and automated reporting, see the [Claude Code ROI Measurement Guide](https://github.com/anthropics/claude-code-monitoring-guide). This repository provides ready-to-use Docker Compose configurations, Prometheus and OpenTelemetry setups, and templates for generating productivity reports integrated with tools like Linear.

499 524 

500## Security/privacy considerations525## Security and privacy

501 526 

502* Telemetry is opt-in and requires explicit configuration527* Telemetry is opt-in and requires explicit configuration

503* Sensitive information like API keys or file contents are never included in metrics or events528* Raw file contents and code snippets are not included in metrics or events. Tool execution events include bash commands and file paths in the `tool_parameters` field, which may contain sensitive values. If your commands may include secrets, configure your telemetry backend to filter or redact `tool_parameters`

504* User prompt content is redacted by default, only prompt length is recorded. To enable user prompt logging, set `OTEL_LOG_USER_PROMPTS=1`529* When authenticated via OAuth, `user.email` is included in telemetry attributes. If this is a concern for your organization, work with your telemetry backend to filter or redact this field

505* MCP server/tool names and skill names are not logged by default because they can reveal user-specific configurations. To enable, set `OTEL_LOG_TOOL_DETAILS=1`530* User prompt content is not collected by default. Only prompt length is recorded. To include prompt content, set `OTEL_LOG_USER_PROMPTS=1`

531* MCP server/tool names and skill names are not logged by default because they can reveal user-specific configurations. To include them, set `OTEL_LOG_TOOL_DETAILS=1`

506 532 

507## Monitoring Claude Code on Amazon Bedrock533## Monitor Claude Code on Amazon Bedrock

508 534 

509For detailed Claude Code usage monitoring guidance for Amazon Bedrock, see [Claude Code Monitoring Implementation (Bedrock)](https://github.com/aws-solutions-library-samples/guidance-for-claude-code-with-amazon-bedrock/blob/main/assets/docs/MONITORING.md).535For detailed Claude Code usage monitoring guidance for Amazon Bedrock, see [Claude Code Monitoring Implementation (Bedrock)](https://github.com/aws-solutions-library-samples/guidance-for-claude-code-with-amazon-bedrock/blob/main/assets/docs/MONITORING.md).

permissions.md +1 −2

Details

33Claude Code supports several permission modes that control how tools are approved. Set the `defaultMode` in your [settings files](/en/settings#settings-files):33Claude Code supports several permission modes that control how tools are approved. Set the `defaultMode` in your [settings files](/en/settings#settings-files):

34 34 

35| Mode | Description |35| Mode | Description |

36| :------------------ | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |36| :------------------ | :------------------------------------------------------------------------------------ |

37| `default` | Standard behavior: prompts for permission on first use of each tool |37| `default` | Standard behavior: prompts for permission on first use of each tool |

38| `acceptEdits` | Automatically accepts file edit permissions for the session |38| `acceptEdits` | Automatically accepts file edit permissions for the session |

39| `plan` | Plan Mode: Claude can analyze but not modify files or execute commands |39| `plan` | Plan Mode: Claude can analyze but not modify files or execute commands |

40| `delegate` | Coordination-only mode for agent team leads. Restricts the lead to team management tools, so all implementation work happens through teammates. Only available when an agent team is active. See [delegate mode](/en/agent-teams#delegate-mode) for details. |

41| `dontAsk` | Auto-denies tools unless pre-approved via `/permissions` or `permissions.allow` rules |40| `dontAsk` | Auto-denies tools unless pre-approved via `/permissions` or `permissions.allow` rules |

42| `bypassPermissions` | Skips all permission prompts (requires safe environment, see warning below) |41| `bypassPermissions` | Skips all permission prompts (requires safe environment, see warning below) |

43 42 

plugins.md +8 −8

Details

122 claude --plugin-dir ./my-first-plugin122 claude --plugin-dir ./my-first-plugin

123 ```123 ```

124 124 

125 Once Claude Code starts, try your new command:125 Once Claude Code starts, try your new skill:

126 126 

127 ```shell theme={null}127 ```shell theme={null}

128 /my-first-plugin:hello128 /my-first-plugin:hello

129 ```129 ```

130 130 

131 You'll see Claude respond with a greeting. Run `/help` to see your command listed under the plugin namespace.131 You'll see Claude respond with a greeting. Run `/help` to see your skill listed under the plugin namespace.

132 132 

133 <Note>133 <Note>

134 **Why namespacing?** Plugin skills are always namespaced (like `/greet:hello`) to prevent conflicts when multiple plugins have skills with the same name.134 **Why namespacing?** Plugin skills are always namespaced (like `/greet:hello`) to prevent conflicts when multiple plugins have skills with the same name.


140 <Step title="Add skill arguments">140 <Step title="Add skill arguments">

141 Make your skill dynamic by accepting user input. The `$ARGUMENTS` placeholder captures any text the user provides after the skill name.141 Make your skill dynamic by accepting user input. The `$ARGUMENTS` placeholder captures any text the user provides after the skill name.

142 142 

143 Update your `hello.md` file:143 Update your `SKILL.md` file:

144 144 

145 ```markdown my-first-plugin/commands/hello.md theme={null}145 ```markdown my-first-plugin/skills/hello/SKILL.md theme={null}

146 ---146 ---

147 description: Greet the user with a personalized message147 description: Greet the user with a personalized message

148 ---148 ---

149 149 

150 # Hello Command150 # Hello Skill

151 151 

152 Greet the user named "$ARGUMENTS" warmly and ask how you can help them today. Make the greeting personal and encouraging.152 Greet the user named "$ARGUMENTS" warmly and ask how you can help them today. Make the greeting personal and encouraging.

153 ```153 ```

154 154 

155 Restart Claude Code to pick up the changes, then try the command with your name:155 Restart Claude Code to pick up the changes, then try the skill with your name:

156 156 

157 ```shell theme={null}157 ```shell theme={null}

158 /my-first-plugin:hello Alex158 /my-first-plugin:hello Alex


165You've successfully created and tested a plugin with these key components:165You've successfully created and tested a plugin with these key components:

166 166 

167* **Plugin manifest** (`.claude-plugin/plugin.json`): describes your plugin's metadata167* **Plugin manifest** (`.claude-plugin/plugin.json`): describes your plugin's metadata

168* **Commands directory** (`commands/`): contains your custom skills168* **Skills directory** (`skills/`): contains your custom skills

169* **Skill arguments** (`$ARGUMENTS`): captures user input for dynamic behavior169* **Skill arguments** (`$ARGUMENTS`): captures user input for dynamic behavior

170 170 

171<Tip>171<Tip>


268 268 

269As you make changes to your plugin, restart Claude Code to pick up the updates. Test your plugin components:269As you make changes to your plugin, restart Claude Code to pick up the updates. Test your plugin components:

270 270 

271* Try your commands with `/command-name`271* Try your skills with `/plugin-name:skill-name`

272* Check that agents appear in `/agents`272* Check that agents appear in `/agents`

273* Verify hooks work as expected273* Verify hooks work as expected

274 274 

settings.md +1 −0

Details

176| `language` | Configure Claude's preferred response language (e.g., `"japanese"`, `"spanish"`, `"french"`). Claude will respond in this language by default | `"japanese"` |176| `language` | Configure Claude's preferred response language (e.g., `"japanese"`, `"spanish"`, `"french"`). Claude will respond in this language by default | `"japanese"` |

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

178| `spinnerTipsEnabled` | Show tips in the spinner while Claude is working. Set to `false` to disable tips (default: `true`) | `false` |178| `spinnerTipsEnabled` | Show tips in the spinner while Claude is working. Set to `false` to disable tips (default: `true`) | `false` |

179| `spinnerTipsOverride` | Override spinner tips with custom strings. `tips`: array of tip strings. `excludeDefault`: if `true`, only show custom tips; if `false` or absent, custom tips are merged with built-in tips | `{ "excludeDefault": true, "tips": ["Use our internal tool X"] }` |

179| `terminalProgressBarEnabled` | Enable the terminal progress bar that shows progress in supported terminals like Windows Terminal and iTerm2 (default: `true`) | `false` |180| `terminalProgressBarEnabled` | Enable the terminal progress bar that shows progress in supported terminals like Windows Terminal and iTerm2 (default: `true`) | `false` |

180| `prefersReducedMotion` | Reduce or disable UI animations (spinners, shimmer, flash effects) for accessibility | `true` |181| `prefersReducedMotion` | Reduce or disable UI animations (spinners, shimmer, flash effects) for accessibility | `true` |

181| `teammateMode` | How [agent team](/en/agent-teams) teammates display: `auto` (picks split panes in tmux or iTerm2, in-process otherwise), `in-process`, or `tmux`. See [set up agent teams](/en/agent-teams#set-up-agent-teams) | `"in-process"` |182| `teammateMode` | How [agent team](/en/agent-teams) teammates display: `auto` (picks split panes in tmux or iTerm2, in-process otherwise), `in-process`, or `tmux`. See [set up agent teams](/en/agent-teams#set-up-agent-teams) | `"in-process"` |

sub-agents.md +2 −3

Details

211| `tools` | No | [Tools](#available-tools) the subagent can use. Inherits all tools if omitted |211| `tools` | No | [Tools](#available-tools) the subagent can use. Inherits all tools if omitted |

212| `disallowedTools` | No | Tools to deny, removed from inherited or specified list |212| `disallowedTools` | No | Tools to deny, removed from inherited or specified list |

213| `model` | No | [Model](#choose-a-model) to use: `sonnet`, `opus`, `haiku`, or `inherit`. Defaults to `inherit` |213| `model` | No | [Model](#choose-a-model) to use: `sonnet`, `opus`, `haiku`, or `inherit`. Defaults to `inherit` |

214| `permissionMode` | No | [Permission mode](#permission-modes): `default`, `acceptEdits`, `delegate`, `dontAsk`, `bypassPermissions`, or `plan` |214| `permissionMode` | No | [Permission mode](#permission-modes): `default`, `acceptEdits`, `dontAsk`, `bypassPermissions`, or `plan` |

215| `maxTurns` | No | Maximum number of agentic turns before the subagent stops |215| `maxTurns` | No | Maximum number of agentic turns before the subagent stops |

216| `skills` | No | [Skills](/en/skills) to load into the subagent's context at startup. The full skill content is injected, not just made available for invocation. Subagents don't inherit skills from the parent conversation |216| `skills` | No | [Skills](/en/skills) to load into the subagent's context at startup. The full skill content is injected, not just made available for invocation. Subagents don't inherit skills from the parent conversation |

217| `mcpServers` | No | [MCP servers](/en/mcp) available to this subagent. Each entry is either a server name referencing an already-configured server (e.g., `"slack"`) or an inline definition with the server name as key and a full [MCP server config](/en/mcp#configure-mcp-servers) as value |217| `mcpServers` | No | [MCP servers](/en/mcp) available to this subagent. Each entry is either a server name referencing an already-configured server (e.g., `"slack"`) or an inline definition with the server name as key and a full [MCP server config](/en/mcp#configure-mcp-servers) as value |


272The `permissionMode` field controls how the subagent handles permission prompts. Subagents inherit the permission context from the main conversation but can override the mode.272The `permissionMode` field controls how the subagent handles permission prompts. Subagents inherit the permission context from the main conversation but can override the mode.

273 273 

274| Mode | Behavior |274| Mode | Behavior |

275| :------------------ | :------------------------------------------------------------------------------------------------------------------- |275| :------------------ | :----------------------------------------------------------------- |

276| `default` | Standard permission checking with prompts |276| `default` | Standard permission checking with prompts |

277| `acceptEdits` | Auto-accept file edits |277| `acceptEdits` | Auto-accept file edits |

278| `dontAsk` | Auto-deny permission prompts (explicitly allowed tools still work) |278| `dontAsk` | Auto-deny permission prompts (explicitly allowed tools still work) |

279| `delegate` | Coordination-only mode for [agent team](/en/agent-teams#use-delegate-mode) leads. Restricts to team management tools |

280| `bypassPermissions` | Skip all permission checks |279| `bypassPermissions` | Skip all permission checks |

281| `plan` | Plan mode (read-only exploration) |280| `plan` | Plan mode (read-only exploration) |

282 281 

Details

239 239 

240Encourage new users to try Claude Code for codebase Q\&A, or on smaller bug fixes or feature requests. Ask Claude Code to make a plan. Check Claude's suggestions and give feedback if it's off-track. Over time, as users understand this new paradigm better, then they'll be more effective at letting Claude Code run more agentically.240Encourage new users to try Claude Code for codebase Q\&A, or on smaller bug fixes or feature requests. Ask Claude Code to make a plan. Check Claude's suggestions and give feedback if it's off-track. Over time, as users understand this new paradigm better, then they'll be more effective at letting Claude Code run more agentically.

241 241 

242### Pin model versions for cloud providers

243 

244If you deploy through [Bedrock](/en/amazon-bedrock), [Vertex AI](/en/google-vertex-ai), or [Foundry](/en/microsoft-foundry), pin specific model versions using `ANTHROPIC_DEFAULT_OPUS_MODEL`, `ANTHROPIC_DEFAULT_SONNET_MODEL`, and `ANTHROPIC_DEFAULT_HAIKU_MODEL`. Without pinning, Claude Code aliases resolve to the latest version, which can break users when Anthropic releases a new model that isn't yet enabled in your account. See [Model configuration](/en/model-config#pin-models-for-third-party-deployments) for details.

245 

242### Configure security policies246### Configure security policies

243 247 

244Security teams can configure managed permissions for what Claude Code is and is not allowed to do, which cannot be overwritten by local configuration. [Learn more](/en/security).248Security teams can configure managed permissions for what Claude Code is and is not allowed to do, which cannot be overwritten by local configuration. [Learn more](/en/security).