SpyBara
Go Premium

Documentation 2026-02-04 21:07 UTC to 2026-02-05 21:06 UTC

18 files changed +632 −59. 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 +380 −0 created

Details

1> ## Documentation Index

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

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

4 

5# Orchestrate teams of Claude Code sessions

6 

7> Coordinate multiple Claude Code instances working together as a team, with shared tasks, inter-agent messaging, and centralized management.

8 

9<Warning>

10 Agent teams are experimental and disabled by default. Enable them by adding `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS` to your [settings.json](/en/settings) or environment. Agent teams have [known limitations](#limitations) around session resumption, task coordination, and shutdown behavior.

11</Warning>

12 

13Agent teams let you coordinate multiple Claude Code instances working together. One session acts as the team lead, coordinating work, assigning tasks, and synthesizing results. Teammates work independently, each in its own context window, and communicate directly with each other.

14 

15Unlike [subagents](/en/sub-agents), which run within a single session and can only report back to the main agent, you can also interact with individual teammates directly without going through the lead.

16 

17This page covers:

18 

19* [When to use agent teams](#when-to-use-agent-teams), including best use cases and how they compare with subagents

20* [Starting a team](#start-your-first-agent-team)

21* [Controlling teammates](#control-your-agent-team), including display modes, task assignment, and delegation

22* [Best practices for parallel work](#best-practices)

23 

24## When to use agent teams

25 

26Agent teams are most effective for tasks where parallel exploration adds real value. See [use case examples](#use-case-examples) for full scenarios. The strongest use cases are:

27 

28* **Research and review**: multiple teammates can investigate different aspects of a problem simultaneously, then share and challenge each other's findings

29* **New modules or features**: teammates can each own a separate piece without stepping on each other

30* **Debugging with competing hypotheses**: teammates test different theories in parallel and converge on the answer faster

31* **Cross-layer coordination**: changes that span frontend, backend, and tests, each owned by a different teammate

32 

33Agent teams add coordination overhead and use significantly more tokens than a single session. They work best when teammates can operate independently. For sequential tasks, same-file edits, or work with many dependencies, a single session or [subagents](/en/sub-agents) are more effective.

34 

35### Compare with subagents

36 

37Both agent teams and [subagents](/en/sub-agents) let you parallelize work, but they operate differently. Choose based on whether your workers need to communicate with each other:

38 

39| | Subagents | Agent teams |

40| :---------------- | :----------------------------------------------- | :-------------------------------------------------- |

41| **Context** | Own context window; results return to the caller | Own context window; fully independent |

42| **Communication** | Report results back to the main agent only | Teammates message each other directly |

43| **Coordination** | Main agent manages all work | Shared task list with self-coordination |

44| **Best for** | Focused tasks where only the result matters | Complex work requiring discussion and collaboration |

45| **Token cost** | Lower: results summarized back to main context | Higher: each teammate is a separate Claude instance |

46 

47Use subagents when you need quick, focused workers that report back. Use agent teams when teammates need to share findings, challenge each other, and coordinate on their own.

48 

49## Enable agent teams

50 

51Agent teams are disabled by default. Enable them by setting the `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS` environment variable to `1`, either in your shell environment or through [settings.json](/en/settings):

52 

53```json settings.json theme={null}

54{

55 "env": {

56 "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"

57 }

58}

59```

60 

61## Start your first agent team

62 

63After enabling agent teams, tell Claude to create an agent team and describe the task and the team structure you want in natural language. Claude creates the team, spawns teammates, and coordinates work based on your prompt.

64 

65This example works well because the three roles are independent and can explore the problem without waiting on each other:

66 

67```

68I'm designing a CLI tool that helps developers track TODO comments across

69their codebase. Create an agent team to explore this from different angles: one

70teammate on UX, one on technical architecture, one playing devil's advocate.

71```

72 

73From 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.

74 

75The lead's terminal lists all teammates and what they're working on. Use Shift+Up/Down to select a teammate and message them directly.

76 

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

78 

79## Control your agent team

80 

81Tell the lead what you want in natural language. It handles team coordination, task assignment, and delegation based on your instructions.

82 

83### Choose a display mode

84 

85Agent teams support two display modes:

86 

87* **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.

88* **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.

89 

90<Note>

91 `tmux` has known limitations on certain operating systems and traditionally works best on macOS. Using `tmux -CC` in iTerm2 is the suggested entrypoint into `tmux`.

92</Note>

93 

94The default is `"auto"`, which uses split panes if you're already running inside a tmux session, and in-process otherwise. The `"tmux"` setting enables split-pane mode and auto-detects whether to use tmux or iTerm2 based on your terminal. To override, set `teammateMode` in your [settings.json](/en/settings):

95 

96```json theme={null}

97{

98 "teammateMode": "in-process"

99}

100```

101 

102To force in-process mode for a single session, pass it as a flag:

103 

104```bash theme={null}

105claude --teammate-mode in-process

106```

107 

108Split-pane mode requires either [tmux](https://github.com/tmux/tmux/wiki) or iTerm2 with the [`it2` CLI](https://github.com/mkusaka/it2). To install manually:

109 

110* **tmux**: install through your system's package manager. See the [tmux wiki](https://github.com/tmux/tmux/wiki/Installing) for platform-specific instructions.

111* **iTerm2**: install the [`it2` CLI](https://github.com/mkusaka/it2), then enable the Python API in **iTerm2 → Settings → General → Magic → Enable Python API**.

112 

113### Specify teammates and models

114 

115Claude decides the number of teammates to spawn based on your task, or you can specify exactly what you want:

116 

117```

118Create a team with 4 teammates to refactor these modules in parallel.

119Use Sonnet for each teammate.

120```

121 

122### Require plan approval for teammates

123 

124For complex or risky tasks, you can require teammates to plan before implementing. The teammate works in read-only plan mode until the lead approves their approach:

125 

126```

127Spawn an architect teammate to refactor the authentication module.

128Require plan approval before they make any changes.

129```

130 

131When a teammate finishes planning, it sends a plan approval request to the lead. The lead reviews the plan and either approves it or rejects it with feedback. If rejected, the teammate stays in plan mode, revises based on the feedback, and resubmits. Once approved, the teammate exits plan mode and begins implementation.

132 

133The 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."

134 

135### Use delegate mode

136 

137Without 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.

138 

139This 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.

140 

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

142 

143### Talk to teammates directly

144 

145Each 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.

146 

147* **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.

148* **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.

149 

150### Assign and claim tasks

151 

152The shared task list coordinates work across the team. The lead creates tasks and teammates work through them. Tasks have three states: pending, in progress, and completed. Tasks can also depend on other tasks: a pending task with unresolved dependencies cannot be claimed until those dependencies are completed.

153 

154The lead can assign tasks explicitly, or teammates can self-claim:

155 

156* **Lead assigns**: tell the lead which task to give to which teammate

157* **Self-claim**: after finishing a task, a teammate picks up the next unassigned, unblocked task on its own

158 

159Task claiming uses file locking to prevent race conditions when multiple teammates try to claim the same task simultaneously.

160 

161### Shut down teammates

162 

163To gracefully end a teammate's session:

164 

165```

166Ask the researcher teammate to shut down

167```

168 

169The lead sends a shutdown request. The teammate can approve, exiting gracefully, or reject with an explanation.

170 

171### Clean up the team

172 

173When you're done, ask the lead to clean up:

174 

175```

176Clean up the team

177```

178 

179This removes the shared team resources. When the lead runs cleanup, it checks for active teammates and fails if any are still running, so shut them down first.

180 

181<Warning>

182 Always use the lead to clean up. Teammates should not run cleanup because their team context may not resolve correctly, potentially leaving resources in an inconsistent state.

183</Warning>

184 

185## How agent teams work

186 

187This section covers the architecture and mechanics behind agent teams. If you want to start using them, see [Control your agent team](#control-your-agent-team) above.

188 

189### How Claude starts agent teams

190 

191There are two ways agent teams get started:

192 

193* **You request a team**: give Claude a task that benefits from parallel work and explicitly ask for an agent team. Claude creates one based on your instructions.

194* **Claude proposes a team**: if Claude determines your task would benefit from parallel work, it may suggest creating a team. You confirm before it proceeds.

195 

196In both cases, you stay in control. Claude won't create a team without your approval.

197 

198### Architecture

199 

200An agent team consists of:

201 

202| Component | Role |

203| :------------ | :----------------------------------------------------------------------------------------- |

204| **Team lead** | The main Claude Code session that creates the team, spawns teammates, and coordinates work |

205| **Teammates** | Separate Claude Code instances that each work on assigned tasks |

206| **Task list** | Shared list of work items that teammates claim and complete |

207| **Mailbox** | Messaging system for communication between agents |

208 

209See [Choose a display mode](#choose-a-display-mode) for display configuration options. Teammate messages arrive at the lead automatically.

210 

211The system manages task dependencies automatically. When a teammate completes a task that other tasks depend on, blocked tasks unblock without manual intervention.

212 

213Teams and tasks are stored locally:

214 

215* **Team config**: `~/.claude/teams/{team-name}/config.json`

216* **Task list**: `~/.claude/tasks/{team-name}/`

217 

218The team config contains a `members` array with each teammate's name, agent ID, and agent type. Teammates can read this file to discover other team members.

219 

220### Permissions

221 

222Teammates start with the lead's permission settings. If the lead runs with `--dangerously-skip-permissions`, all teammates do too. After spawning, you can change individual teammate modes, but you can't set per-teammate modes at spawn time.

223 

224### Context and communication

225 

226Each teammate has its own context window. When spawned, a teammate loads the same project context as a regular session: CLAUDE.md, MCP servers, and skills. It also receives the spawn prompt from the lead. The lead's conversation history does not carry over.

227 

228**How teammates share information:**

229 

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

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

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

233 

234**Teammate messaging:**

235 

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

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

238 

239### Token usage

240 

241Agent teams use significantly more tokens than a single session. Each teammate has its own context window, and token usage scales with the number of active teammates. For research, review, and new feature work, the extra tokens are usually worthwhile. For routine tasks, a single session is more cost-effective. See [agent team token costs](/en/costs#agent-team-token-costs) for usage guidance.

242 

243## Use case examples

244 

245These examples show how agent teams handle tasks where parallel exploration adds value.

246 

247### Run a parallel code review

248 

249A single reviewer tends to gravitate toward one type of issue at a time. Splitting review criteria into independent domains means security, performance, and test coverage all get thorough attention simultaneously. The prompt assigns each teammate a distinct lens so they don't overlap:

250 

251```

252Create an agent team to review PR #142. Spawn three reviewers:

253- One focused on security implications

254- One checking performance impact

255- One validating test coverage

256Have them each review and report findings.

257```

258 

259Each reviewer works from the same PR but applies a different filter. The lead synthesizes findings across all three after they finish.

260 

261### Investigate with competing hypotheses

262 

263When the root cause is unclear, a single agent tends to find one plausible explanation and stop looking. The prompt fights this by making teammates explicitly adversarial: each one's job is not only to investigate its own theory but to challenge the others'.

264 

265```

266Users report the app exits after one message instead of staying connected.

267Spawn 5 agent teammates to investigate different hypotheses. Have them talk to

268each other to try to disprove each other's theories, like a scientific

269debate. Update the findings doc with whatever consensus emerges.

270```

271 

272The debate structure is the key mechanism here. Sequential investigation suffers from anchoring: once one theory is explored, subsequent investigation is biased toward it.

273 

274With multiple independent investigators actively trying to disprove each other, the theory that survives is much more likely to be the actual root cause.

275 

276## Best practices

277 

278### Give teammates enough context

279 

280Teammates load project context automatically, including CLAUDE.md, MCP servers, and skills, but they don't inherit the lead's conversation history. See [Context and communication](#context-and-communication) for details. Include task-specific details in the spawn prompt:

281 

282```

283Spawn a security reviewer teammate with the prompt: "Review the authentication module

284at src/auth/ for security vulnerabilities. Focus on token handling, session

285management, and input validation. The app uses JWT tokens stored in

286httpOnly cookies. Report any issues with severity ratings."

287```

288 

289### Size tasks appropriately

290 

291* **Too small**: coordination overhead exceeds the benefit

292* **Too large**: teammates work too long without check-ins, increasing risk of wasted effort

293* **Just right**: self-contained units that produce a clear deliverable, such as a function, a test file, or a review

294 

295<Tip>

296 The lead breaks work into tasks and assigns them to teammates automatically. If it isn't creating enough tasks, ask it to split the work into smaller pieces. Having 5-6 tasks per teammate keeps everyone productive and lets the lead reassign work if someone gets stuck.

297</Tip>

298 

299### Wait for teammates to finish

300 

301Sometimes the lead starts implementing tasks itself instead of waiting for teammates. If you notice this:

302 

303```

304Wait for your teammates to complete their tasks before proceeding

305```

306 

307### Start with research and review

308 

309If you're new to agent teams, start with tasks that have clear boundaries and don't require writing code: reviewing a PR, researching a library, or investigating a bug. These tasks show the value of parallel exploration without the coordination challenges that come with parallel implementation.

310 

311### Avoid file conflicts

312 

313Two teammates editing the same file leads to overwrites. Break the work so each teammate owns a different set of files.

314 

315### Monitor and steer

316 

317Check in on teammates' progress, redirect approaches that aren't working, and synthesize findings as they come in. Letting a team run unattended for too long increases the risk of wasted effort.

318 

319## Troubleshooting

320 

321### Teammates not appearing

322 

323If teammates aren't appearing after you ask Claude to create a team:

324 

325* In in-process mode, teammates may already be running but not visible. Press Shift+Down to cycle through active teammates.

326* Check that the task you gave Claude was complex enough to warrant a team. Claude decides whether to spawn teammates based on the task.

327* If you explicitly requested split panes, ensure tmux is installed and available in your PATH:

328 ```bash theme={null}

329 which tmux

330 ```

331* For iTerm2, verify the `it2` CLI is installed and the Python API is enabled in iTerm2 preferences.

332 

333### Too many permission prompts

334 

335Teammate permission requests bubble up to the lead, which can create friction. Pre-approve common operations in your [permission settings](/en/permissions) before spawning teammates to reduce interruptions.

336 

337### Teammates stopping on errors

338 

339Teammates 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:

340 

341* Give them additional instructions directly

342* Spawn a replacement teammate to continue the work

343 

344### Lead shuts down before work is done

345 

346The lead may decide the team is finished before all tasks are actually complete. If this happens, tell it to keep going. You can also tell the lead to wait for teammates to finish before proceeding if it starts doing work instead of delegating.

347 

348### Orphaned tmux sessions

349 

350If a tmux session persists after the team ends, it may not have been fully cleaned up. List sessions and kill the one created by the team:

351 

352```bash theme={null}

353tmux ls

354tmux kill-session -t <session-name>

355```

356 

357## Limitations

358 

359Agent teams are experimental. Current limitations to be aware of:

360 

361* **No session resumption with in-process teammates**: `/resume` and `/rewind` do not restore in-process teammates. After resuming a session, the lead may attempt to message teammates that no longer exist. If this happens, tell the lead to spawn new teammates.

362* **Task status can lag**: teammates sometimes fail to mark tasks as completed, which blocks dependent tasks. If a task appears stuck, check whether the work is actually done and update the task status manually or tell the lead to nudge the teammate.

363* **Shutdown can be slow**: teammates finish their current request or tool call before shutting down, which can take time.

364* **One team per session**: a lead can only manage one team at a time. Clean up the current team before starting a new one.

365* **No nested teams**: teammates cannot spawn their own teams or teammates. Only the lead can manage the team.

366* **Lead is fixed**: the session that creates the team is the lead for its lifetime. You can't promote a teammate to lead or transfer leadership.

367* **Permissions set at spawn**: all teammates start with the lead's permission mode. You can change individual teammate modes after spawning, but you can't set per-teammate modes at spawn time.

368* **Split panes require tmux or iTerm2**: the default in-process mode works in any terminal. Split-pane mode isn't supported in VS Code's integrated terminal, Windows Terminal, or Ghostty.

369 

370<Tip>

371 **`CLAUDE.md` works normally**: teammates read `CLAUDE.md` files from their working directory. Use this to provide project-specific guidance to all teammates.

372</Tip>

373 

374## Next steps

375 

376Explore related approaches for parallel work and delegation:

377 

378* **Lightweight delegation**: [subagents](/en/sub-agents) spawn helper agents for research or verification within your session, better for tasks that don't need inter-agent coordination

379* **Manual parallel sessions**: [Git worktrees](/en/common-workflows#run-parallel-claude-code-sessions-with-git-worktrees) let you run multiple Claude Code sessions yourself without automated team coordination

380* **Compare approaches**: see the [subagent vs agent team](/en/features-overview#compare-similar-features) comparison for a side-by-side breakdown

Details

485 Run multiple Claude sessions in parallel to speed up development, run isolated experiments, or start complex workflows.485 Run multiple Claude sessions in parallel to speed up development, run isolated experiments, or start complex workflows.

486</Tip>486</Tip>

487 487 

488There are two main ways to run parallel sessions:488There are three main ways to run parallel sessions:

489 489 

490* [Claude Desktop](/en/desktop): Manage multiple local sessions visually. Each session gets its own isolated worktree.490* [Claude Desktop](/en/desktop): Manage multiple local sessions visually. Each session gets its own isolated worktree.

491* [Claude Code on the web](/en/claude-code-on-the-web): Run on Anthropic's secure cloud infrastructure in isolated VMs.491* [Claude Code on the web](/en/claude-code-on-the-web): Run on Anthropic's secure cloud infrastructure in isolated VMs.

492* [Agent teams](/en/agent-teams): Automated coordination of multiple sessions with shared tasks, messaging, and a team lead.

492 493 

493Beyond parallelizing work, multiple sessions enable quality-focused workflows. A fresh context improves code review since Claude won't be biased toward code it just wrote.494Beyond parallelizing work, multiple sessions enable quality-focused workflows. A fresh context improves code review since Claude won't be biased toward code it just wrote.

494 495 

Details

70| `--system-prompt` | Replace the entire system prompt with custom text (works in both interactive and print modes) | `claude --system-prompt "You are a Python expert"` |70| `--system-prompt` | Replace the entire system prompt with custom text (works in both interactive and print modes) | `claude --system-prompt "You are a Python expert"` |

71| `--system-prompt-file` | Load system prompt from a file, replacing the default prompt (print mode only) | `claude -p --system-prompt-file ./custom-prompt.txt "query"` |71| `--system-prompt-file` | Load system prompt from a file, replacing the default prompt (print mode only) | `claude -p --system-prompt-file ./custom-prompt.txt "query"` |

72| `--teleport` | Resume a [web session](/en/claude-code-on-the-web) in your local terminal | `claude --teleport` |72| `--teleport` | Resume a [web session](/en/claude-code-on-the-web) in your local terminal | `claude --teleport` |

73| `--teammate-mode` | Set how [agent team](/en/agent-teams) teammates display: `auto` (default), `in-process`, or `tmux`. See [set up agent teams](/en/agent-teams#set-up-agent-teams) | `claude --teammate-mode in-process` |

73| `--tools` | Restrict which built-in tools Claude can use (works in both interactive and print modes). Use `""` to disable all, `"default"` for all, or tool names like `"Bash,Edit,Read"` | `claude --tools "Bash,Edit,Read"` |74| `--tools` | Restrict which built-in tools Claude can use (works in both interactive and print modes). Use `""` to disable all, `"default"` for all, or tool names like `"Bash,Edit,Read"` | `claude --tools "Bash,Edit,Read"` |

74| `--verbose` | Enable verbose logging, shows full turn-by-turn output (helpful for debugging in both print and interactive modes) | `claude --verbose` |75| `--verbose` | Enable verbose logging, shows full turn-by-turn output (helpful for debugging in both print and interactive modes) | `claude --verbose` |

75| `--version`, `-v` | Output the version number | `claude -v` |76| `--version`, `-v` | Output the version number | `claude -v` |

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

244 244 

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

246 246 


509 509 

510## Use extended thinking (thinking mode)510## Use extended thinking (thinking mode)

511 511 

512[Extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking) is enabled by default, reserving a portion of the output token budget (up to 31,999 tokens) for Claude to reason through complex problems step-by-step. This reasoning is visible in verbose mode, which you can toggle on with `Ctrl+O`.512[Extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking) is enabled by default, giving Claude space to reason through complex problems step-by-step before responding. This reasoning is visible in verbose mode, which you can toggle on with `Ctrl+O`.

513 513 

514Extended thinking is particularly valuable for complex architectural decisions, challenging bugs, multi-step implementation planning, and evaluating tradeoffs between different approaches. It provides more space for exploring multiple solutions, analyzing edge cases, and self-correcting mistakes.514Additionally, Opus 4.6 introduces adaptive reasoning: instead of a fixed thinking token budget, the model dynamically allocates thinking based on your [effort level](/en/model-config#adjust-effort-level) setting. Extended thinking and adaptive reasoning work together to give you control over how deeply Claude reasons before responding.

515 

516Extended thinking is particularly valuable for complex architectural decisions, challenging bugs, multi-step implementation planning, and evaluating tradeoffs between different approaches.

515 517 

516<Note>518<Note>

517 Phrases like "think", "think hard", "ultrathink", and "think more" are interpreted as regular prompt instructions and don't allocate thinking tokens.519 Phrases like "think", "think hard", "ultrathink", and "think more" are interpreted as regular prompt instructions and don't allocate thinking tokens.


522Thinking is enabled by default, but you can adjust or disable it.524Thinking is enabled by default, but you can adjust or disable it.

523 525 

524| Scope | How to configure | Details |526| Scope | How to configure | Details |

525| ---------------------- | ------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------- |527| ---------------------- | ------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------- |

526| **Toggle shortcut** | Press `Option+T` (macOS) or `Alt+T` (Windows/Linux) | Toggle thinking on/off for the current session. May require [terminal configuration](/en/terminal-config) to enable Option key shortcuts |528| **Effort level** | Adjust in `/model` or set [`CLAUDE_CODE_EFFORT_LEVEL`](/en/settings#environment-variables) | Control thinking depth for Opus 4.6: low, medium, high (default). See [Adjust effort level](/en/model-config#adjust-effort-level) |

527| **Global default** | Use `/config` to toggle thinking mode | Sets your default across all projects.<br />Saved as `alwaysThinkingEnabled` in `~/.claude/settings.json` |529| **Toggle shortcut** | Press `Option+T` (macOS) or `Alt+T` (Windows/Linux) | Toggle thinking on/off for the current session (all models). May require [terminal configuration](/en/terminal-config) to enable Option key shortcuts |

528| **Limit token budget** | Set [`MAX_THINKING_TOKENS`](/en/settings#environment-variables) environment variable | Limit the thinking budget to a specific number of tokens. Example: `export MAX_THINKING_TOKENS=10000` |530| **Global default** | Use `/config` to toggle thinking mode | Sets your default across all projects (all models).<br />Saved as `alwaysThinkingEnabled` in `~/.claude/settings.json` |

531| **Limit token budget** | Set [`MAX_THINKING_TOKENS`](/en/settings#environment-variables) environment variable | Limit the thinking budget to a specific number of tokens (ignored on Opus 4.6 unless set to 0). Example: `export MAX_THINKING_TOKENS=10000` |

529 532 

530To view Claude's thinking process, press `Ctrl+O` to toggle verbose mode and see the internal reasoning displayed as gray italic text.533To view Claude's thinking process, press `Ctrl+O` to toggle verbose mode and see the internal reasoning displayed as gray italic text.

531 534 

532### How extended thinking token budgets work535### How extended thinking works

533 

534Extended thinking uses a **token budget** that controls how much internal reasoning Claude can perform before responding.

535 

536A larger thinking token budget provides:

537 536 

538* More space to explore multiple solution approaches step-by-step537Extended thinking controls how much internal reasoning Claude performs before responding. More thinking provides more space to explore solutions, analyze edge cases, and self-correct mistakes.

539* Room to analyze edge cases and evaluate tradeoffs thoroughly

540* Ability to revise reasoning and self-correct mistakes

541 538 

542Token budgets for thinking mode:539**With Opus 4.6**, thinking uses adaptive reasoning: the model dynamically allocates thinking tokens based on the [effort level](/en/model-config#adjust-effort-level) you select (low, medium, high). This is the recommended way to tune the tradeoff between speed and reasoning depth.

543 540 

544* When thinking is **enabled**, Claude can use up to **31,999 tokens** from your output budget for internal reasoning541**With other models**, thinking uses a fixed budget of up to 31,999 tokens from your output budget. You can limit this with the [`MAX_THINKING_TOKENS`](/en/settings#environment-variables) environment variable, or disable thinking entirely via `/config` or the `Option+T`/`Alt+T` toggle.

545* When thinking is **disabled** (via toggle or `/config`), Claude uses **0 tokens** for thinking

546 542 

547**Limit the thinking budget:**543`MAX_THINKING_TOKENS` is ignored when using Opus 4.6, since adaptive reasoning controls thinking depth instead. The one exception: setting `MAX_THINKING_TOKENS=0` still disables thinking entirely on any model.

548 

549* Use the [`MAX_THINKING_TOKENS` environment variable](/en/settings#environment-variables) to cap the thinking budget

550* When set, this value limits the maximum tokens Claude can use for thinking

551* See the [extended thinking documentation](https://docs.claude.com/en/docs/build-with-claude/extended-thinking) for valid token ranges

552 544 

553<Warning>545<Warning>

554 You're charged for all thinking tokens used, even though Claude 4 models show summarized thinking546 You're charged for all thinking tokens used, even though Claude 4 models show summarized thinking


715 * Other languages: Following your project's standard setup process707 * Other languages: Following your project's standard setup process

716</Tip>708</Tip>

717 709 

710For automated coordination of parallel sessions with shared tasks and messaging, see [agent teams](/en/agent-teams).

711 

718***712***

719 713 

720## Use Claude as a unix-style utility714## Use Claude as a unix-style utility

costs.md +19 −3

Details

37 When you first authenticate Claude Code with your Claude Console account, a workspace called "Claude Code" is automatically created for you. This workspace provides centralized cost tracking and management for all Claude Code usage in your organization. You cannot create API keys for this workspace; it is exclusively for Claude Code authentication and usage.37 When you first authenticate Claude Code with your Claude Console account, a workspace called "Claude Code" is automatically created for you. This workspace provides centralized cost tracking and management for all Claude Code usage in your organization. You cannot create API keys for this workspace; it is exclusively for Claude Code authentication and usage.

38</Note>38</Note>

39 39 

40On Bedrock, Vertex, and Foundry, Claude Code does not send metrics from your cloud. To get cost metrics, several large enterprises reported using [LiteLLM](/en/llm-gateway#litellm-configuration), which is an open-source tool that helps companies [track spend by key](https://docs.litellm.ai/docs/proxy/virtual_keys#tracking-spend). This project is unaffiliated with Anthropic and we have not audited its security.40On Bedrock, Vertex, and Foundry, Claude Code does not send metrics from your cloud. To get cost metrics, several large enterprises reported using [LiteLLM](/en/llm-gateway#litellm-configuration), which is an open-source tool that helps companies [track spend by key](https://docs.litellm.ai/docs/proxy/virtual_keys#tracking-spend). This project is unaffiliated with Anthropic and has not been audited for security.

41 41 

42### Rate limit recommendations42### Rate limit recommendations

43 43 


54 54 

55For example, if you have 200 users, you might request 20k TPM for each user, or 4 million total TPM (200\*20,000 = 4 million).55For example, if you have 200 users, you might request 20k TPM for each user, or 4 million total TPM (200\*20,000 = 4 million).

56 56 

57The TPM per user decreases as team size grows because we expect fewer users to use Claude Code concurrently in larger organizations. These rate limits apply at the organization level, not per individual user, which means individual users can temporarily consume more than their calculated share when others aren't actively using the service.57The TPM per user decreases as team size grows because fewer users tend to use Claude Code concurrently in larger organizations. These rate limits apply at the organization level, not per individual user, which means individual users can temporarily consume more than their calculated share when others aren't actively using the service.

58 58 

59<Note>59<Note>

60 If you anticipate scenarios with unusually high concurrent usage (such as live training sessions with large groups), you may need higher TPM allocations per user.60 If you anticipate scenarios with unusually high concurrent usage (such as live training sessions with large groups), you may need higher TPM allocations per user.

61</Note>61</Note>

62 62 

63### Agent team token costs

64 

65[Agent teams](/en/agent-teams) spawn multiple Claude Code instances, each with its own context window. Token usage scales with the number of active teammates and how long each one runs.

66 

67To keep agent team costs manageable:

68 

69* Use Sonnet for teammates. It balances capability and cost for coordination tasks.

70* Keep teams small. Each teammate runs its own context window, so token usage is roughly proportional to team size.

71* Keep spawn prompts focused. Teammates load CLAUDE.md, MCP servers, and skills automatically, but everything in the spawn prompt adds to their context from the start.

72* Clean up teams when work is done. Active teammates continue consuming tokens even if idle.

73* Agent teams are disabled by default. Set `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1` in your [settings.json](/en/settings) or environment to enable them. See [enable agent teams](/en/agent-teams#enable-agent-teams).

74 

63## Reduce token usage75## Reduce token usage

64 76 

65Token costs scale with context size: the more context Claude processes, the more tokens you use. Claude Code automatically optimizes costs through prompt caching (which reduces costs for repeated content like system prompts) and auto-compaction (which summarizes conversation history when approaching context limits).77Token costs scale with context size: the more context Claude processes, the more tokens you use. Claude Code automatically optimizes costs through prompt caching (which reduces costs for repeated content like system prompts) and auto-compaction (which summarizes conversation history when approaching context limits).


153 165 

154### Adjust extended thinking166### Adjust extended thinking

155 167 

156Extended thinking is enabled by default with a budget of 31,999 tokens because it significantly improves performance on complex planning and reasoning tasks. However, thinking tokens are billed as output tokens, so for simpler tasks where deep reasoning isn't needed, you can reduce costs by disabling it in `/config` or lowering the budget (for example, `MAX_THINKING_TOKENS=8000`).168Extended thinking is enabled by default with a budget of 31,999 tokens because it significantly improves performance on complex planning and reasoning tasks. However, thinking tokens are billed as output tokens, so for simpler tasks where deep reasoning isn't needed, you can reduce costs by lowering the [effort level](/en/model-config#adjust-effort-level) in `/model` for Opus 4.6, disabling thinking in `/config`, or lowering the budget (for example, `MAX_THINKING_TOKENS=8000`).

157 169 

158### Delegate verbose operations to subagents170### Delegate verbose operations to subagents

159 171 

160Running tests, fetching documentation, or processing log files can consume significant context. Delegate these to [subagents](/en/sub-agents#isolate-high-volume-operations) so the verbose output stays in the subagent's context while only a summary returns to your main conversation.172Running tests, fetching documentation, or processing log files can consume significant context. Delegate these to [subagents](/en/sub-agents#isolate-high-volume-operations) so the verbose output stays in the subagent's context while only a summary returns to your main conversation.

161 173 

174### Manage agent team costs

175 

176Agent teams use approximately 7x more tokens than standard sessions when teammates run in plan mode, because each teammate maintains its own context window and runs as a separate Claude instance. Keep team tasks small and self-contained to limit per-teammate token usage. See [agent teams](/en/agent-teams) for details.

177 

162### Write specific prompts178### Write specific prompts

163 179 

164Vague requests like "improve this codebase" trigger broad scanning. Specific requests like "add input validation to the login function in auth.ts" let Claude work efficiently with minimal file reads.180Vague requests like "improve this codebase" trigger broad scanning. Specific requests like "add input validation to the login function in auth.ts" let Claude work efficiently with minimal file reads.

Details

22* **[Skills](/en/skills)** add reusable knowledge and invocable workflows22* **[Skills](/en/skills)** add reusable knowledge and invocable workflows

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

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

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

25* **[Hooks](/en/hooks)** run outside the loop entirely as deterministic scripts26* **[Hooks](/en/hooks)** run outside the loop entirely as deterministic scripts

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

27 28 


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

33 34 

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

35| ------------- | ---------------------------------------------------------- | ------------------------------------------------------ | -------------------------------------------------------------------------------- |36| ---------------------------------- | ---------------------------------------------------------- | ------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- |

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

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

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

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

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

40| **Hook** | Deterministic script that runs on events | Predictable automation, no LLM involved | Run ESLint after every file edit |42| **Hook** | Deterministic script that runs on events | Predictable automation, no LLM involved | Run ESLint after every file edit |

41 43 


82 **Rule of thumb:** Keep CLAUDE.md under \~500 lines. If it's growing, move reference content to skills.84 **Rule of thumb:** Keep CLAUDE.md under \~500 lines. If it's growing, move reference content to skills.

83 </Tab>85 </Tab>

84 86 

87 <Tab title="Subagent vs Agent team">

88 Both parallelize work, but they're architecturally different:

89 

90 * **Subagents** run inside your session and report results back to your main context

91 * **Agent teams** are independent Claude Code sessions that communicate with each other

92 

93 | Aspect | Subagent | Agent team |

94 | ----------------- | ------------------------------------------------ | --------------------------------------------------- |

95 | **Context** | Own context window; results return to the caller | Own context window; fully independent |

96 | **Communication** | Reports results back to the main agent only | Teammates message each other directly |

97 | **Coordination** | Main agent manages all work | Shared task list with self-coordination |

98 | **Best for** | Focused tasks where only the result matters | Complex work requiring discussion and collaboration |

99 | **Token cost** | Lower: results summarized back to main context | Higher: each teammate is a separate Claude instance |

100 

101 **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. Your main conversation stays clean.

102 

103 **Use an agent team** when teammates need to share findings, challenge each other, and coordinate independently. Agent teams are best for research with competing hypotheses, parallel code review, and new feature development where each teammate owns a separate piece.

104 

105 **Transition point:** If you're running parallel subagents but hitting context limits, or if your subagents need to communicate with each other, agent teams are the natural next step.

106 

107 <Note>

108 Agent teams are experimental and disabled by default. See [agent teams](/en/agent-teams) for setup and current limitations.

109 </Note>

110 </Tab>

111 

85 <Tab title="MCP vs Skill">112 <Tab title="MCP vs Skill">

86 MCP connects Claude to external services. Skills extend what Claude knows, including how to use those services effectively.113 MCP connects Claude to external services. Skills extend what Claude knows, including how to use those services effectively.

87 114 


229 Offload work to isolated context256 Offload work to isolated context

230 </Card>257 </Card>

231 258 

259 <Card title="Agent teams" icon="network" href="/en/agent-teams">

260 Coordinate multiple sessions working in parallel

261 </Card>

262 

232 <Card title="MCP" icon="plug" href="/en/mcp">263 <Card title="MCP" icon="plug" href="/en/mcp">

233 Connect Claude to external services264 Connect Claude to external services

234 </Card>265 </Card>

Details

16</Note>16</Note>

17 17 

18<Info>18<Info>

19 **Claude Opus 4.5 is now available.** Claude Code GitHub Actions default to Sonnet. To use Opus 4.5, configure the [model parameter](#breaking-changes-reference) to use `claude-opus-4-5-20251101`.19 **Claude Opus 4.6 is now available.** Claude Code GitHub Actions default to Sonnet. To use Opus 4.6, configure the [model parameter](#breaking-changes-reference) to use `claude-opus-4-6`.

20</Info>20</Info>

21 21 

22## Why use Claude Code GitHub Actions?22## Why use Claude Code GitHub Actions?


193 with:193 with:

194 anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}194 anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}

195 prompt: "Generate a summary of yesterday's commits and open issues"195 prompt: "Generate a summary of yesterday's commits and open issues"

196 claude_args: "--model claude-opus-4-5-20251101"196 claude_args: "--model opus"

197```197```

198 198 

199### Common use cases199### Common use cases

Details

109To customize models:109To customize models:

110 110 

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

112export ANTHROPIC_MODEL='claude-opus-4-1@20250805'112export ANTHROPIC_MODEL='claude-opus-4-6'

113export ANTHROPIC_SMALL_FAST_MODEL='claude-haiku-4-5@20251001'113export ANTHROPIC_SMALL_FAST_MODEL='claude-haiku-4-5@20251001'

114```114```

115 115 

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.

145 146 

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

147 148 

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 |


32| `Ctrl+R` | Reverse search command history | Search through previous commands interactively |32| `Ctrl+R` | Reverse search command history | Search through previous commands interactively |

33| `Ctrl+V` or `Cmd+V` (iTerm2) or `Alt+V` (Windows) | Paste image from clipboard | Pastes an image or path to an image file |33| `Ctrl+V` or `Cmd+V` (iTerm2) or `Alt+V` (Windows) | Paste image from clipboard | Pastes an image or path to an image file |

34| `Ctrl+B` | Background running tasks | Backgrounds bash commands and agents. Tmux users press twice |34| `Ctrl+B` | Background running tasks | Backgrounds bash commands and agents. Tmux users press twice |

35| `Ctrl+T` | Toggle task list | Show or hide the [task list](#task-list) in the terminal status area |

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

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

37| `Esc` + `Esc` | Rewind the code/conversation | Restore the code and/or conversation to a previous point |38| `Esc` + `Esc` | Rewind the code/conversation | Restore the code and/or conversation to a previous point |

38| `Shift+Tab` or `Alt+M` (some configurations) | Toggle permission modes | Switch between Auto-Accept Mode, Plan Mode, and normal mode |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| `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 |

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

41 42 


89To create your own commands you can invoke with `/`, see [skills](/en/skills).90To create your own commands you can invoke with `/`, see [skills](/en/skills).

90 91 

91| Command | Purpose |92| Command | Purpose |

92| :------------------------ | :-------------------------------------------------------------------------------------------------------------------------- |93| :------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

93| `/clear` | Clear conversation history |94| `/clear` | Clear conversation history |

94| `/compact [instructions]` | Compact conversation with optional focus instructions |95| `/compact [instructions]` | Compact conversation with optional focus instructions |

95| `/config` | Open the Settings interface (Config tab) |96| `/config` | Open the Settings interface (Config tab) |


103| `/init` | Initialize project with `CLAUDE.md` guide |104| `/init` | Initialize project with `CLAUDE.md` guide |

104| `/mcp` | Manage MCP server connections and OAuth authentication |105| `/mcp` | Manage MCP server connections and OAuth authentication |

105| `/memory` | Edit `CLAUDE.md` memory files |106| `/memory` | Edit `CLAUDE.md` memory files |

106| `/model` | Select or change the AI model. The change takes effect immediately without waiting for the current response to finish |107| `/model` | Select or change the AI model. With Opus 4.6, use left/right arrows to [adjust effort level](/en/model-config#adjust-effort-level). The change takes effect immediately without waiting for the current response to finish |

107| `/permissions` | View or update [permissions](/en/permissions#manage-permissions) |108| `/permissions` | View or update [permissions](/en/permissions#manage-permissions) |

108| `/plan` | Enter plan mode directly from the prompt |109| `/plan` | Enter plan mode directly from the prompt |

109| `/rename <name>` | Rename the current session for easier identification |110| `/rename <name>` | Rename the current session for easier identification |

mcp.md +64 −0

Details

618 * OAuth authentication works with HTTP servers618 * OAuth authentication works with HTTP servers

619</Tip>619</Tip>

620 620 

621### Use pre-configured OAuth credentials

622 

623Some MCP servers don't support automatic OAuth setup. If you see an error like "Incompatible auth server: does not support dynamic client registration," the server requires pre-configured credentials. Register an OAuth app through the server's developer portal first, then provide the credentials when adding the server.

624 

625<Steps>

626 <Step title="Register an OAuth app with the server">

627 Create an app through the server's developer portal and note your client ID and client secret.

628 

629 Many servers also require a redirect URI. If so, choose a port and register a redirect URI in the format `http://localhost:PORT/callback`. Use that same port with `--callback-port` in the next step.

630 </Step>

631 

632 <Step title="Add the server with your credentials">

633 Choose one of the following methods. The port used for `--callback-port` can be any available port. It just needs to match the redirect URI you registered in the previous step.

634 

635 <Tabs>

636 <Tab title="claude mcp add">

637 Use `--client-id` to pass your app's client ID. The `--client-secret` flag prompts for the secret with masked input:

638 

639 ```bash theme={null}

640 claude mcp add --transport http \

641 --client-id your-client-id --client-secret --callback-port 8080 \

642 my-server https://mcp.example.com/mcp

643 ```

644 </Tab>

645 

646 <Tab title="claude mcp add-json">

647 Include the `oauth` object in the JSON config and pass `--client-secret` as a separate flag:

648 

649 ```bash theme={null}

650 claude mcp add-json my-server \

651 '{"type":"http","url":"https://mcp.example.com/mcp","oauth":{"clientId":"your-client-id","callbackPort":8080}}' \

652 --client-secret

653 ```

654 </Tab>

655 

656 <Tab title="CI / env var">

657 Set the secret via environment variable to skip the interactive prompt:

658 

659 ```bash theme={null}

660 MCP_CLIENT_SECRET=your-secret claude mcp add --transport http \

661 --client-id your-client-id --client-secret --callback-port 8080 \

662 my-server https://mcp.example.com/mcp

663 ```

664 </Tab>

665 </Tabs>

666 </Step>

667 

668 <Step title="Authenticate in Claude Code">

669 Run `/mcp` in Claude Code and follow the browser login flow.

670 </Step>

671</Steps>

672 

673<Tip>

674 Tips:

675 

676 * The client secret is stored securely in your system keychain (macOS) or a credentials file, not in your config

677 * If the server uses a public OAuth client with no secret, use only `--client-id` without `--client-secret`

678 * These flags only apply to HTTP and SSE transports. They have no effect on stdio servers

679 * Use `claude mcp get <name>` to verify that OAuth credentials are configured for a server

680</Tip>

681 

621## Add MCP servers from JSON configuration682## Add MCP servers from JSON configuration

622 683 

623If you have a JSON configuration for an MCP server, you can add it directly:684If you have a JSON configuration for an MCP server, you can add it directly:


633 694 

634 # Example: Adding a stdio server with JSON configuration695 # Example: Adding a stdio server with JSON configuration

635 claude mcp add-json local-weather '{"type":"stdio","command":"/path/to/weather-cli","args":["--api-key","abc123"],"env":{"CACHE_DIR":"/tmp"}}'696 claude mcp add-json local-weather '{"type":"stdio","command":"/path/to/weather-cli","args":["--api-key","abc123"],"env":{"CACHE_DIR":"/tmp"}}'

697 

698 # Example: Adding an HTTP server with pre-configured OAuth credentials

699 claude mcp add-json my-server '{"type":"http","url":"https://mcp.example.com/mcp","oauth":{"clientId":"your-client-id","callbackPort":8080}}' --client-secret

636 ```700 ```

637 </Step>701 </Step>

638 702 

Details

73# Set models to your resource's deployment names73# Set models to your resource's deployment names

74export ANTHROPIC_DEFAULT_SONNET_MODEL='claude-sonnet-4-5'74export ANTHROPIC_DEFAULT_SONNET_MODEL='claude-sonnet-4-5'

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

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

77```77```

78 78 

79For more details on model configuration options, see [Model configuration](/en/model-config).79For more details on model configuration options, see [Model configuration](/en/model-config).

model-config.md +40 −14

Details

12 12 

13* A **model alias**13* A **model alias**

14* A **model name**14* A **model name**

15 * Anthropic API: A full **[model name](https://docs.claude.com/en/docs/about-claude/models/overview#model-names)**15 * Anthropic API: A full **[model name](https://platform.claude.com/docs/en/about-claude/models/overview)**

16 * Bedrock: an inference profile ARN16 * Bedrock: an inference profile ARN

17 * Foundry: a deployment name17 * Foundry: a deployment name

18 * Vertex: a version name18 * Vertex: a version name


23remembering exact version numbers:23remembering exact version numbers:

24 24 

25| Model alias | Behavior |25| Model alias | Behavior |

26| ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |26| ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

27| **`default`** | Recommended model setting, depending on your account type |27| **`default`** | Recommended model setting, depending on your account type |

28| **`sonnet`** | Uses the latest Sonnet model (currently Sonnet 4.5) for daily coding tasks |28| **`sonnet`** | Uses the latest Sonnet model (currently Sonnet 4.5) for daily coding tasks |

29| **`opus`** | Uses Opus model (currently Opus 4.5) for specialized complex reasoning tasks |29| **`opus`** | Uses the latest Opus model (currently Opus 4.6) for complex reasoning tasks |

30| **`haiku`** | Uses the fast and efficient Haiku model for simple tasks |30| **`haiku`** | Uses the fast and efficient Haiku model for simple tasks |

31| **`sonnet[1m]`** | Uses Sonnet with a [1 million token context window](https://docs.claude.com/en/docs/build-with-claude/context-windows#1m-token-context-window) window for long sessions |31| **`sonnet[1m]`** | Uses Sonnet with a [1 million token context window](https://platform.claude.com/docs/en/build-with-claude/context-windows#1m-token-context-window) for long sessions |

32| **`opusplan`** | Special mode that uses `opus` during plan mode, then switches to `sonnet` for execution |32| **`opusplan`** | Special mode that uses `opus` during plan mode, then switches to `sonnet` for execution |

33 33 

34Aliases always point to the latest version. To pin to a specific version, use the full model name (for example, `claude-opus-4-5-20251101`) or set the corresponding environment variable like `ANTHROPIC_DEFAULT_OPUS_MODEL`.

35 

34### Setting your model36### Setting your model

35 37 

36You can configure your model in several ways, listed in order of priority:38You can configure your model in several ways, listed in order of priority:


66 68 

67### `default` model setting69### `default` model setting

68 70 

69The behavior of `default` depends on your account type.71The behavior of `default` depends on your account type:

72 

73* **Max and Teams**: defaults to Opus 4.6

74* **Pro**: defaults to Opus 4.6 in Claude Code

75* **Enterprise**: Opus 4.6 is available but not the default

70 76 

71For certain Max users, Claude Code will automatically fall back to Sonnet if you77Claude Code may automatically fall back to Sonnet if you hit a usage threshold with Opus.

72hit a usage threshold with Opus.

73 78 

74### `opusplan` model setting79### `opusplan` model setting

75 80 


83This gives you the best of both worlds: Opus's superior reasoning for planning,88This gives you the best of both worlds: Opus's superior reasoning for planning,

84and Sonnet's efficiency for execution.89and Sonnet's efficiency for execution.

85 90 

91### Adjust effort level

92 

93[Effort levels](https://platform.claude.com/docs/en/build-with-claude/effort) control Opus 4.6's adaptive reasoning, which dynamically allocates thinking based on task complexity. Lower effort is faster and cheaper for straightforward tasks, while higher effort provides deeper reasoning for complex problems.

94 

95Three levels are available: **low**, **medium**, and **high** (default).

96 

97**Setting effort:**

98 

99* **In `/model`**: use left/right arrow keys to adjust the effort slider when selecting a model

100* **Environment variable**: set `CLAUDE_CODE_EFFORT_LEVEL=low|medium|high`

101* **Settings**: set `effortLevel` in your settings file

102 

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

104 

86### Extended context with \[1m]105### Extended context with \[1m]

87 106 

88For Console/API users, the `[1m]` suffix can be added to full model names to107The `[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.

89enable a108 

90[1 million token context window](https://docs.claude.com/en/docs/build-with-claude/context-windows#1m-token-context-window).109<Note>

110 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.

111</Note>

112 

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

91 114 

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

93# Example of using a full model name with the [1m] suffix116# Use the sonnet[1m] alias

94/model anthropic.claude-sonnet-4-5-20250929-v1:0[1m]117/model sonnet[1m]

118 

119# Or append [1m] to a full model name

120/model claude-sonnet-4-5-20250929[1m]

95```121```

96 122 

97Note: Extended context models have123Note: Extended context models have

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

99 125 

100## Checking your current model126## Checking your current model

101 127 


121 147 

122### Prompt caching configuration148### Prompt caching configuration

123 149 

124Claude Code automatically uses [prompt caching](https://docs.claude.com/en/docs/build-with-claude/prompt-caching) to optimize performance and reduce costs. You can disable prompt caching globally or for specific model tiers:150Claude 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:

125 151 

126| Environment variable | Description |152| Environment variable | Description |

127| ------------------------------- | ---------------------------------------------------------------------------------------------- |153| ------------------------------- | ---------------------------------------------------------------------------------------------- |

overview.md +5 −5

Details

21 <Tab title="Native Install (Recommended)">21 <Tab title="Native Install (Recommended)">

22 **macOS, Linux, WSL:**22 **macOS, Linux, WSL:**

23 23 

24 ```bash theme={null} theme={null} theme={null}24 ```bash theme={null}

25 curl -fsSL https://claude.ai/install.sh | bash25 curl -fsSL https://claude.ai/install.sh | bash

26 ```26 ```

27 27 

28 **Windows PowerShell:**28 **Windows PowerShell:**

29 29 

30 ```powershell theme={null} theme={null} theme={null}30 ```powershell theme={null}

31 irm https://claude.ai/install.ps1 | iex31 irm https://claude.ai/install.ps1 | iex

32 ```32 ```

33 33 

34 **Windows CMD:**34 **Windows CMD:**

35 35 

36 ```batch theme={null} theme={null} theme={null}36 ```batch theme={null}

37 curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd37 curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd

38 ```38 ```

39 39 


43 </Tab>43 </Tab>

44 44 

45 <Tab title="Homebrew">45 <Tab title="Homebrew">

46 ```sh theme={null} theme={null} theme={null}46 ```sh theme={null}

47 brew install --cask claude-code47 brew install --cask claude-code

48 ```48 ```

49 49 


53 </Tab>53 </Tab>

54 54 

55 <Tab title="WinGet">55 <Tab title="WinGet">

56 ```powershell theme={null} theme={null} theme={null}56 ```powershell theme={null}

57 winget install Anthropic.ClaudeCode57 winget install Anthropic.ClaudeCode

58 ```58 ```

59 59 

permissions.md +2 −1

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

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

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

42 43 

settings.md +9 −2

Details

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

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

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

180| `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"` |

180 181 

181### Permission settings182### Permission settings

182 183 


740</Note>741</Note>

741 742 

742| Variable | Purpose | |743| Variable | Purpose | |

743| :--------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- |744| :--------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- |

744| `ANTHROPIC_API_KEY` | API key sent as `X-Api-Key` header, typically for the Claude SDK (for interactive usage, run `/login`) | |745| `ANTHROPIC_API_KEY` | API key sent as `X-Api-Key` header, typically for the Claude SDK (for interactive usage, run `/login`) | |

745| `ANTHROPIC_AUTH_TOKEN` | Custom value for the `Authorization` header (the value you set here will be prefixed with `Bearer `) | |746| `ANTHROPIC_AUTH_TOKEN` | Custom value for the `Authorization` header (the value you set here will be prefixed with `Bearer `) | |

746| `ANTHROPIC_CUSTOM_HEADERS` | Custom headers to add to requests (`Name: Value` format, newline-separated for multiple headers) | |747| `ANTHROPIC_CUSTOM_HEADERS` | Custom headers to add to requests (`Name: Value` format, newline-separated for multiple headers) | |


760| `CLAUDE_AUTOCOMPACT_PCT_OVERRIDE` | Set the percentage of context capacity (1-100) at which auto-compaction triggers. By default, auto-compaction triggers at approximately 95% capacity. Use lower values like `50` to compact earlier. Values above the default threshold have no effect. Applies to both main conversations and subagents. This percentage aligns with the `context_window.used_percentage` field available in [status line](/en/statusline) | |761| `CLAUDE_AUTOCOMPACT_PCT_OVERRIDE` | Set the percentage of context capacity (1-100) at which auto-compaction triggers. By default, auto-compaction triggers at approximately 95% capacity. Use lower values like `50` to compact earlier. Values above the default threshold have no effect. Applies to both main conversations and subagents. This percentage aligns with the `context_window.used_percentage` field available in [status line](/en/statusline) | |

761| `CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR` | Return to the original working directory after each Bash command | |762| `CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR` | Return to the original working directory after each Bash command | |

762| `CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD` | Set to `1` to load CLAUDE.md files from directories specified with `--add-dir`. By default, additional directories do not load memory files | `1` |763| `CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD` | Set to `1` to load CLAUDE.md files from directories specified with `--add-dir`. By default, additional directories do not load memory files | `1` |

764| `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS` | Set to `1` to enable [agent teams](/en/agent-teams). Agent teams are experimental and disabled by default | |

763| `CLAUDE_CODE_API_KEY_HELPER_TTL_MS` | Interval in milliseconds at which credentials should be refreshed (when using `apiKeyHelper`) | |765| `CLAUDE_CODE_API_KEY_HELPER_TTL_MS` | Interval in milliseconds at which credentials should be refreshed (when using `apiKeyHelper`) | |

764| `CLAUDE_CODE_CLIENT_CERT` | Path to client certificate file for mTLS authentication | |766| `CLAUDE_CODE_CLIENT_CERT` | Path to client certificate file for mTLS authentication | |

765| `CLAUDE_CODE_CLIENT_KEY_PASSPHRASE` | Passphrase for encrypted CLAUDE\_CODE\_CLIENT\_KEY (optional) | |767| `CLAUDE_CODE_CLIENT_KEY_PASSPHRASE` | Passphrase for encrypted CLAUDE\_CODE\_CLIENT\_KEY (optional) | |

766| `CLAUDE_CODE_CLIENT_KEY` | Path to client private key file for mTLS authentication | |768| `CLAUDE_CODE_CLIENT_KEY` | Path to client private key file for mTLS authentication | |

769| `CLAUDE_CODE_EFFORT_LEVEL` | Set the effort level for supported models. Values: `low`, `medium`, `high` (default). Lower effort is faster and cheaper, higher effort provides deeper reasoning. Currently supported with Opus 4.6 only. See [Adjust effort level](/en/model-config#adjust-effort-level) | |

767| `CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS` | Set to `1` to disable Anthropic API-specific `anthropic-beta` headers. Use this if experiencing issues like "Unexpected value(s) for the `anthropic-beta` header" when using an LLM gateway with third-party providers | |770| `CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS` | Set to `1` to disable Anthropic API-specific `anthropic-beta` headers. Use this if experiencing issues like "Unexpected value(s) for the `anthropic-beta` header" when using an LLM gateway with third-party providers | |

768| `CLAUDE_CODE_DISABLE_BACKGROUND_TASKS` | Set to `1` to disable all background task functionality, including the `run_in_background` parameter on Bash and subagent tools, auto-backgrounding, and the Ctrl+B shortcut | |771| `CLAUDE_CODE_DISABLE_BACKGROUND_TASKS` | Set to `1` to disable all background task functionality, including the `run_in_background` parameter on Bash and subagent tools, auto-backgrounding, and the Ctrl+B shortcut | |

769| `CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY` | Set to `1` to disable the "How is Claude doing?" session quality surveys. Also disabled when using third-party providers or when telemetry is disabled. See [Session quality surveys](/en/data-usage#session-quality-surveys) | |772| `CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY` | Set to `1` to disable the "How is Claude doing?" session quality surveys. Also disabled when using third-party providers or when telemetry is disabled. See [Session quality surveys](/en/data-usage#session-quality-surveys) | |

770| `CLAUDE_CODE_EXIT_AFTER_STOP_DELAY` | Time in milliseconds to wait after the query loop becomes idle before automatically exiting. Useful for automated workflows and scripts using SDK mode | |773| `CLAUDE_CODE_EXIT_AFTER_STOP_DELAY` | Time in milliseconds to wait after the query loop becomes idle before automatically exiting. Useful for automated workflows and scripts using SDK mode | |

771| `CLAUDE_CODE_PROXY_RESOLVES_HOSTS` | Set to `true` to allow the proxy to perform DNS resolution instead of the caller. Opt-in for environments where the proxy should handle hostname resolution | |774| `CLAUDE_CODE_PROXY_RESOLVES_HOSTS` | Set to `true` to allow the proxy to perform DNS resolution instead of the caller. Opt-in for environments where the proxy should handle hostname resolution | |

772| `CLAUDE_CODE_TASK_LIST_ID` | Share a task list across sessions. Set the same ID in multiple Claude Code instances to coordinate on a shared task list. See [Task list](/en/interactive-mode#task-list) | |775| `CLAUDE_CODE_TASK_LIST_ID` | Share a task list across sessions. Set the same ID in multiple Claude Code instances to coordinate on a shared task list. See [Task list](/en/interactive-mode#task-list) | |

776| `CLAUDE_CODE_TEAM_NAME` | Name of the agent team this teammate belongs to. Set automatically on [agent team](/en/agent-teams) members | |

773| `CLAUDE_CODE_TMPDIR` | Override the temp directory used for internal temp files. Claude Code appends `/claude/` to this path. Default: `/tmp` on Unix/macOS, `os.tmpdir()` on Windows | |777| `CLAUDE_CODE_TMPDIR` | Override the temp directory used for internal temp files. Claude Code appends `/claude/` to this path. Default: `/tmp` on Unix/macOS, `os.tmpdir()` on Windows | |

774| `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC` | Equivalent of setting `DISABLE_AUTOUPDATER`, `DISABLE_BUG_COMMAND`, `DISABLE_ERROR_REPORTING`, and `DISABLE_TELEMETRY` | |778| `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC` | Equivalent of setting `DISABLE_AUTOUPDATER`, `DISABLE_BUG_COMMAND`, `DISABLE_ERROR_REPORTING`, and `DISABLE_TELEMETRY` | |

775| `CLAUDE_CODE_DISABLE_TERMINAL_TITLE` | Set to `1` to disable automatic terminal title updates based on conversation context | |779| `CLAUDE_CODE_DISABLE_TERMINAL_TITLE` | Set to `1` to disable automatic terminal title updates based on conversation context | |


781| `CLAUDE_CODE_IDE_SKIP_AUTO_INSTALL` | Skip auto-installation of IDE extensions | |785| `CLAUDE_CODE_IDE_SKIP_AUTO_INSTALL` | Skip auto-installation of IDE extensions | |

782| `CLAUDE_CODE_MAX_OUTPUT_TOKENS` | Set the maximum number of output tokens for most requests. Default: 32,000. Maximum: 64,000. Increasing this value reduces the effective context window available before [auto-compaction](/en/costs#reduce-token-usage) triggers. | |786| `CLAUDE_CODE_MAX_OUTPUT_TOKENS` | Set the maximum number of output tokens for most requests. Default: 32,000. Maximum: 64,000. Increasing this value reduces the effective context window available before [auto-compaction](/en/costs#reduce-token-usage) triggers. | |

783| `CLAUDE_CODE_OTEL_HEADERS_HELPER_DEBOUNCE_MS` | Interval for refreshing dynamic OpenTelemetry headers in milliseconds (default: 1740000 / 29 minutes). See [Dynamic headers](/en/monitoring-usage#dynamic-headers) | |787| `CLAUDE_CODE_OTEL_HEADERS_HELPER_DEBOUNCE_MS` | Interval for refreshing dynamic OpenTelemetry headers in milliseconds (default: 1740000 / 29 minutes). See [Dynamic headers](/en/monitoring-usage#dynamic-headers) | |

788| `CLAUDE_CODE_PLAN_MODE_REQUIRED` | Auto-set to `true` on [agent team](/en/agent-teams) teammates that require plan approval. Read-only: set by Claude Code when spawning teammates. See [require plan approval](/en/agent-teams#require-plan-approval-for-teammates) | |

784| `CLAUDE_CODE_SHELL` | Override automatic shell detection. Useful when your login shell differs from your preferred working shell (for example, `bash` vs `zsh`) | |789| `CLAUDE_CODE_SHELL` | Override automatic shell detection. Useful when your login shell differs from your preferred working shell (for example, `bash` vs `zsh`) | |

785| `CLAUDE_CODE_SHELL_PREFIX` | Command prefix to wrap all bash commands (for example, for logging or auditing). Example: `/path/to/logger.sh` will execute `/path/to/logger.sh <command>` | |790| `CLAUDE_CODE_SHELL_PREFIX` | Command prefix to wrap all bash commands (for example, for logging or auditing). Example: `/path/to/logger.sh` will execute `/path/to/logger.sh <command>` | |

786| `CLAUDE_CODE_SKIP_BEDROCK_AUTH` | Skip AWS authentication for Bedrock (for example, when using an LLM gateway) | |791| `CLAUDE_CODE_SKIP_BEDROCK_AUTH` | Skip AWS authentication for Bedrock (for example, when using an LLM gateway) | |


808| `HTTPS_PROXY` | Specify HTTPS proxy server for network connections | |813| `HTTPS_PROXY` | Specify HTTPS proxy server for network connections | |

809| `IS_DEMO` | Set to `true` to enable demo mode: hides email and organization from the UI, skips onboarding, and hides internal commands. Useful for streaming or recording sessions | |814| `IS_DEMO` | Set to `true` to enable demo mode: hides email and organization from the UI, skips onboarding, and hides internal commands. Useful for streaming or recording sessions | |

810| `MAX_MCP_OUTPUT_TOKENS` | Maximum number of tokens allowed in MCP tool responses. Claude Code displays a warning when output exceeds 10,000 tokens (default: 25000) | |815| `MAX_MCP_OUTPUT_TOKENS` | Maximum number of tokens allowed in MCP tool responses. Claude Code displays a warning when output exceeds 10,000 tokens (default: 25000) | |

811| `MAX_THINKING_TOKENS` | Override the [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking) token budget. Thinking is enabled at max budget (31,999 tokens) by default. Use this to limit the budget (for example, `MAX_THINKING_TOKENS=10000`) or disable thinking entirely (`MAX_THINKING_TOKENS=0`). Extended thinking improves performance on complex reasoning and coding tasks but impacts [prompt caching efficiency](https://platform.claude.com/docs/en/build-with-claude/prompt-caching#caching-with-thinking-blocks). | |816| `MAX_THINKING_TOKENS` | Override the [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking) token budget. Thinking is enabled at max budget (31,999 tokens) by default. Use this to limit the budget (for example, `MAX_THINKING_TOKENS=10000`) or disable thinking entirely (`MAX_THINKING_TOKENS=0`). For Opus 4.6, thinking depth is controlled by [effort level](/en/model-config#adjust-effort-level) instead, and this variable is ignored unless set to `0` to disable thinking. | |

817| `MCP_CLIENT_SECRET` | OAuth client secret for MCP servers that require [pre-configured credentials](/en/mcp#use-pre-configured-oauth-credentials). Avoids the interactive prompt when adding a server with `--client-secret` | |

818| `MCP_OAUTH_CALLBACK_PORT` | Fixed port for the OAuth redirect callback, as an alternative to `--callback-port` when adding an MCP server with [pre-configured credentials](/en/mcp#use-pre-configured-oauth-credentials) | |

812| `MCP_TIMEOUT` | Timeout in milliseconds for MCP server startup | |819| `MCP_TIMEOUT` | Timeout in milliseconds for MCP server startup | |

813| `MCP_TOOL_TIMEOUT` | Timeout in milliseconds for MCP tool execution | |820| `MCP_TOOL_TIMEOUT` | Timeout in milliseconds for MCP tool execution | |

814| `NO_PROXY` | List of domains and IPs to which requests will be directly issued, bypassing proxy | |821| `NO_PROXY` | List of domains and IPs to which requests will be directly issued, bypassing proxy | |

statusline.md +1 −1

Details

45 "transcript_path": "/path/to/transcript.json",45 "transcript_path": "/path/to/transcript.json",

46 "cwd": "/current/working/directory",46 "cwd": "/current/working/directory",

47 "model": {47 "model": {

48 "id": "claude-opus-4-1",48 "id": "claude-opus-4-6",

49 "display_name": "Opus"49 "display_name": "Opus"

50 },50 },

51 "workspace": {51 "workspace": {

sub-agents.md +50 −0

Details

8 8 

9Subagents are specialized AI assistants that handle specific types of tasks. Each subagent runs in its own context window with a custom system prompt, specific tool access, and independent permissions. When Claude encounters a task that matches a subagent's description, it delegates to that subagent, which works independently and returns results.9Subagents are specialized AI assistants that handle specific types of tasks. Each subagent runs in its own context window with a custom system prompt, specific tool access, and independent permissions. When Claude encounters a task that matches a subagent's description, it delegates to that subagent, which works independently and returns results.

10 10 

11<Note>

12 If you need multiple agents working in parallel and communicating with each other, see [agent teams](/en/agent-teams) instead. Subagents work within a single session; agent teams coordinate across separate sessions.

13</Note>

14 

11Subagents help you:15Subagents help you:

12 16 

13* **Preserve context** by keeping exploration and implementation out of your main conversation17* **Preserve context** by keeping exploration and implementation out of your main conversation


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

211| `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 |215| `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 |

212| `hooks` | No | [Lifecycle hooks](#define-hooks-for-subagents) scoped to this subagent |216| `hooks` | No | [Lifecycle hooks](#define-hooks-for-subagents) scoped to this subagent |

217| `memory` | No | [Persistent memory scope](#enable-persistent-memory): `user`, `project`, or `local`. Enables cross-session learning |

213 218 

214### Choose a model219### Choose a model

215 220 


278 This is the inverse of [running a skill in a subagent](/en/skills#run-skills-in-a-subagent). With `skills` in a subagent, the subagent controls the system prompt and loads skill content. With `context: fork` in a skill, the skill content is injected into the agent you specify. Both use the same underlying system.283 This is the inverse of [running a skill in a subagent](/en/skills#run-skills-in-a-subagent). With `skills` in a subagent, the subagent controls the system prompt and loads skill content. With `context: fork` in a skill, the skill content is injected into the agent you specify. Both use the same underlying system.

279</Note>284</Note>

280 285 

286#### Enable persistent memory

287 

288The `memory` field designates a persistent directory for the subagent to write to across conversations. The subagent uses this directory to build up knowledge over time: codebase patterns, debugging insights, architectural decisions, and other learnings.

289 

290```yaml theme={null}

291---

292name: code-reviewer

293description: Reviews code for quality and best practices

294memory: user

295---

296 

297You are a code reviewer. As you review code, update your agent memory with

298patterns, conventions, and recurring issues you discover.

299```

300 

301Choose a scope based on how broadly the memory should apply:

302 

303| Scope | Location | Use when |

304| :-------- | :-------------------------------------------- | :------------------------------------------------------------------------------------------ |

305| `user` | `~/.claude/agent-memory/<name-of-agent>/` | the subagent should remember learnings across all projects |

306| `project` | `.claude/agent-memory/<name-of-agent>/` | the subagent's knowledge is project-specific and shareable via version control |

307| `local` | `.claude/agent-memory-local/<name-of-agent>/` | the subagent's knowledge is project-specific but should not be checked into version control |

308 

309When memory is enabled:

310 

311* The subagent's system prompt includes instructions for reading and writing to the memory directory.

312* The subagent's system prompt also includes the first 200 lines of `MEMORY.md` in the memory directory, with instructions to curate `MEMORY.md` if it exceeds 200 lines.

313* Read, Write, and Edit tools are automatically enabled so the subagent can manage its memory files.

314 

315##### Persistent memory tips

316 

317* `user` is the recommended default scope. Use `project` or `local` when the subagent's knowledge is only relevant to a specific codebase.

318* Ask the subagent to consult its memory before starting work: "Review this PR, and check your memory for patterns you've seen before."

319* Ask the subagent to update its memory after completing a task: "Now that you're done, save what you learned to your memory." Over time, this builds a knowledge base that makes the subagent more effective.

320* Include memory instructions directly in the subagent's markdown file so it proactively maintains its own knowledge base:

321 

322 ```

323 **Update your agent memory** as you discover codepaths, patterns, library

324 locations, and key architectural decisions. This builds up institutional

325 knowledge across conversations. Write concise notes about what you found

326 and where.

327 ```

328 

281#### Conditional rules with hooks329#### Conditional rules with hooks

282 330 

283For more dynamic control over tool usage, use `PreToolUse` hooks to validate operations before they execute. This is useful when you need to allow some operations of a tool while blocking others.331For more dynamic control over tool usage, use `PreToolUse` hooks to validate operations before they execute. This is useful when you need to allow some operations of a tool while blocking others.


467 When subagents complete, their results return to your main conversation. Running many subagents that each return detailed results can consume significant context.515 When subagents complete, their results return to your main conversation. Running many subagents that each return detailed results can consume significant context.

468</Warning>516</Warning>

469 517 

518For tasks that need sustained parallelism or exceed your context window, [agent teams](/en/agent-teams) give each worker its own independent context.

519 

470#### Chain subagents520#### Chain subagents

471 521 

472For multi-step workflows, ask Claude to use subagents in sequence. Each subagent completes its task and returns results to Claude, which then passes relevant context to the next subagent.522For multi-step workflows, ask Claude to use subagents in sequence. Each subagent completes its task and returns results to Claude, which then passes relevant context to the next subagent.