Skip to content

Commit fa6807b

Browse files
author
github-actions
committed
docs: sync 2026-08-15
1 parent baafb3d commit fa6807b

23 files changed

Lines changed: 887 additions & 562 deletions

docs/agent-sdk/agent-loop.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ The SDK includes the same tools that power Claude Code:
149149
| **Discovery** | `ToolSearch` | Dynamically find and load tools on-demand instead of preloading all of them |
150150
| **Orchestration** | `Agent`, `Skill`, `AskUserQuestion`, `TaskCreate`, `TaskUpdate` | Spawn subagents, invoke skills, ask the user, track tasks |
151151

152+
On the [models that don't get the task-tracking tools](/docs/en/agent-sdk/todo-tracking#model-availability), Claude Code provides `TaskCreate` and `TaskUpdate` only when you opt in.
153+
152154
Beyond built-in tools, you can:
153155

154156
* **Connect external services** with [MCP servers](/docs/en/agent-sdk/mcp) (databases, browsers, APIs)

docs/agent-sdk/python.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2846,7 +2846,17 @@ When Monitor runs a command, it follows the same permission rules as Bash; a Web
28462846
**Tool name:** `TodoWrite`
28472847
28482848
<Note>
2849-
As of Claude Code v2.1.142, `TodoWrite` is disabled by default. Use `TaskCreate`, `TaskGet`, `TaskUpdate`, and `TaskList` instead. See [Migrate to Task tools](/docs/en/agent-sdk/todo-tracking#migrate-to-task-tools) to update your monitoring code, or set `CLAUDE_CODE_ENABLE_TASKS=0` to revert to `TodoWrite`.
2849+
On Python Agent SDK 0.2.139 and later, the following tools aren't available on Opus 4.8, Sonnet 5, Fable 5, Mythos 5, or later versions of those families unless you opt in:
2850+
2851+
* `TodoWrite`
2852+
* `TaskCreate`
2853+
* `TaskGet`
2854+
* `TaskUpdate`
2855+
* `TaskList`
2856+
2857+
On other models, Claude Code provides the Task tools by default and `TodoWrite` only when you set `CLAUDE_CODE_ENABLE_TASKS=0`.
2858+
2859+
See [Model availability](/docs/en/agent-sdk/todo-tracking#model-availability) to opt in and [Migrate to Task tools](/docs/en/agent-sdk/todo-tracking#migrate-to-task-tools) to update your monitoring code.
28502860
</Note>
28512861
28522862
**Input:**

docs/agent-sdk/todo-tracking.md

Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,25 @@
99
The Claude Agent SDK includes built-in todo functionality that helps organize complex workflows and keep users informed about task progression.
1010

1111
<Note>
12-
As of TypeScript Agent SDK 0.3.142 and Claude Code v2.1.142, sessions use the structured Task tools `TaskCreate`, `TaskUpdate`, `TaskGet`, and `TaskList` instead of `TodoWrite`. The Python SDK gets this change from the Claude Code CLI it launches, not from the Python package version: the switch applies once that CLI — the copy bundled inside the pip package, or one you point to with `cli_path` — is v2.1.142 or later. See [Migrate to Task tools](#migrate-to-task-tools) for how monitoring code changes. The examples on this page set `CLAUDE_CODE_ENABLE_TASKS=0` to keep showing `TodoWrite` for sessions that have not migrated yet.
12+
On TypeScript Agent SDK 0.3.233 and later, or Python Agent SDK 0.2.139 and later, the following tools aren't available on Opus 4.8, Sonnet 5, Fable 5, Mythos 5, or later versions of those families unless you opt in:
13+
14+
* `TodoWrite`
15+
* `TaskCreate`
16+
* `TaskGet`
17+
* `TaskUpdate`
18+
* `TaskList`
19+
20+
On other models, Claude Code provides the Task tools by default and `TodoWrite` only when you set `CLAUDE_CODE_ENABLE_TASKS=0`.
1321
</Note>
1422

23+
### Model availability
24+
25+
On the [models that don't get the task-tracking tools](/docs/en/tools-reference#task-tool-availability), you see no `tool_use` blocks for them in the message stream unless you opt in. If you point `cli_path` in Python or `pathToClaudeCodeExecutable` in TypeScript at your own Claude Code install, you get whichever tools that install provides. To get the same tools as on other models, do one of the following:
26+
27+
* Name one of the tools in the [`allowedTools`](/docs/en/agent-sdk/permissions#allow-and-deny-rules) option, `allowed_tools` in Python
28+
* List the tools in the `tools` option, which restricts the session's built-in tools to the ones it names. Include the tools you want alongside the other built-in tools you use
29+
* Set `CLAUDE_CODE_ENABLE_TODO_TOOLS=1` in the `env` option, as the examples on this page do. In TypeScript, `env` replaces the subprocess environment, so spread `...process.env` to keep inherited variables. In Python, `env` is merged on top of the inherited environment
30+
1531
### Todo Lifecycle
1632

1733
Claude moves each todo through a predictable lifecycle:
@@ -52,8 +68,9 @@ See [Handle the result](/docs/en/agent-sdk/agent-loop#handle-the-result) for the
5268
for await (const message of query({
5369
prompt: "Optimize my React app performance and track progress with todos",
5470
// Re-enable TodoWrite, which this example monitors. Without it, the SDK uses
55-
// Task tools instead and these tool_use blocks never appear.
56-
options: { maxTurns: 15, env: { ...process.env, CLAUDE_CODE_ENABLE_TASKS: "0" } }
71+
// Task tools instead and these tool_use blocks never appear. ENABLE_TODO_TOOLS
72+
// keeps the tools on models where Claude Code otherwise doesn't provide them.
73+
options: { maxTurns: 15, env: { ...process.env, CLAUDE_CODE_ENABLE_TASKS: "0", CLAUDE_CODE_ENABLE_TODO_TOOLS: "1" } }
5774
})) {
5875
// Todo updates are reflected in the message stream
5976
if (message.type === "assistant") {
@@ -89,8 +106,9 @@ See [Handle the result](/docs/en/agent-sdk/agent-loop#handle-the-result) for the
89106
async for message in query(
90107
prompt="Optimize my React app performance and track progress with todos",
91108
# Re-enable TodoWrite, which this example monitors. Without it, the SDK uses
92-
# Task tools instead and these tool_use blocks never appear.
93-
options=ClaudeAgentOptions(max_turns=15, env={"CLAUDE_CODE_ENABLE_TASKS": "0"}),
109+
# Task tools instead and these tool_use blocks never appear. ENABLE_TODO_TOOLS
110+
# keeps the tools on models where Claude Code otherwise doesn't provide them.
111+
options=ClaudeAgentOptions(max_turns=15, env={"CLAUDE_CODE_ENABLE_TASKS": "0", "CLAUDE_CODE_ENABLE_TODO_TOOLS": "1"}),
94112
):
95113
# Todo updates are reflected in the message stream
96114
if isinstance(message, AssistantMessage):
@@ -149,8 +167,8 @@ See [Handle the result](/docs/en/agent-sdk/agent-loop#handle-the-result) for the
149167
try {
150168
for await (const message of query({
151169
prompt,
152-
// Re-enable TodoWrite, which this tracker watches for.
153-
options: { maxTurns: 20, env: { ...process.env, CLAUDE_CODE_ENABLE_TASKS: "0" } }
170+
// On every model, re-enable TodoWrite, which this tracker watches for.
171+
options: { maxTurns: 20, env: { ...process.env, CLAUDE_CODE_ENABLE_TASKS: "0", CLAUDE_CODE_ENABLE_TODO_TOOLS: "1" } }
154172
})) {
155173
if (message.type === "assistant") {
156174
for (const block of message.message.content) {
@@ -215,8 +233,8 @@ See [Handle the result](/docs/en/agent-sdk/agent-loop#handle-the-result) for the
215233
try:
216234
async for message in query(
217235
prompt=prompt,
218-
# Re-enable TodoWrite, which this tracker watches for.
219-
options=ClaudeAgentOptions(max_turns=20, env={"CLAUDE_CODE_ENABLE_TASKS": "0"}),
236+
# On every model, re-enable TodoWrite, which this tracker watches for.
237+
options=ClaudeAgentOptions(max_turns=20, env={"CLAUDE_CODE_ENABLE_TASKS": "0", "CLAUDE_CODE_ENABLE_TODO_TOOLS": "1"}),
220238
):
221239
if isinstance(message, AssistantMessage):
222240
for block in message.content:
@@ -241,7 +259,7 @@ See [Handle the result](/docs/en/agent-sdk/agent-loop#handle-the-result) for the
241259

242260
## Migrate to Task tools
243261

244-
The Task tools split the single `TodoWrite` call into `TaskCreate` for each new item and `TaskUpdate` for each status change, with `TaskList` and `TaskGet` available for the model to read back the current list. Your monitoring code still inspects `tool_use` blocks in the assistant stream, but maintains a map keyed by task ID instead of replacing the whole list on every call. The Task tools are the default as of TypeScript Agent SDK 0.3.142 and Claude Code v2.1.142, so no `options.env` change is needed.
262+
The Task tools split the single `TodoWrite` call into `TaskCreate` for each new item and `TaskUpdate` for each status change, with `TaskList` and `TaskGet` available for the model to read back the current list. Your monitoring code still inspects `tool_use` blocks in the assistant stream, but maintains a map keyed by task ID instead of replacing the whole list on every call.
245263

246264
| With `TodoWrite` | With Task tools |
247265
| --------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
@@ -250,7 +268,9 @@ The Task tools split the single `TodoWrite` call into `TaskCreate` for each new
250268
| Item shape: `{ content, status, activeForm }` | `TaskCreate` input: `{ subject, description, activeForm?, metadata? }`. `TaskUpdate` input: `{ taskId, status?, subject?, description?, activeForm?, addBlocks?, addBlockedBy?, owner?, metadata? }`. `status` is `"pending"`, `"in_progress"`, or `"completed"`; set `status: "deleted"` to delete |
251269
| Render `block.input.todos` directly | Accumulate items across calls, or read a snapshot from a `TaskList` tool result |
252270

253-
The assigned task ID is not in the `TaskCreate` input. It comes back in the matching `tool_result` as `{ task: { id, subject } }`, so capture it from the result block to key your map. The following example shows the minimal change to the [Monitoring Todo Changes](#monitoring-todo-changes) loop. It reads only `tool_use` inputs and skips capturing IDs from `tool_result` blocks. To render a complete list, watch for a `TaskList` tool result in the stream or accumulate `TaskCreate` results and `TaskUpdate` inputs into a map.
271+
The assigned task ID is not in the `TaskCreate` input. It comes back in the matching `tool_result` as `{ task: { id, subject } }`, so capture it from the result block to key your map.
272+
273+
The following example shows the minimal change to the [Monitoring Todo Changes](#monitoring-todo-changes) loop. It leaves `CLAUDE_CODE_ENABLE_TASKS` unset, because the Task tools are the default, and sets only `CLAUDE_CODE_ENABLE_TODO_TOOLS=1`, the [opt-in](#model-availability) for the models that otherwise don't get the tools. It reads only `tool_use` inputs and skips capturing IDs from `tool_result` blocks. To render a complete list, watch for a `TaskList` tool result in the stream or accumulate `TaskCreate` results and `TaskUpdate` inputs into a map.
254274

255275
The streamed `tool_use` input is the raw shape the model emitted. Claude Code repairs some close-but-incorrect key names before execution, mapping `id` or `task_id` to `taskId` and `active_form` to `activeForm`, but that repair is not reflected in the stream. Read `TaskUpdate` input fields defensively, as the samples below do, rather than assuming the canonical name is always present.
256276

@@ -261,7 +281,8 @@ The streamed `tool_use` input is the raw shape the model emitted. Claude Code re
261281
try {
262282
for await (const message of query({
263283
prompt: "Optimize my React app performance and track progress with todos",
264-
options: { maxTurns: 15 },
284+
// Keeps the Task tools on models where Claude Code otherwise doesn't provide them.
285+
options: { maxTurns: 15, env: { ...process.env, CLAUDE_CODE_ENABLE_TODO_TOOLS: "1" } },
265286
})) {
266287
if (message.type !== "assistant") continue;
267288
for (const block of message.message.content) {
@@ -296,7 +317,8 @@ The streamed `tool_use` input is the raw shape the model emitted. Claude Code re
296317
try:
297318
async for message in query(
298319
prompt="Optimize my React app performance and track progress with todos",
299-
options=ClaudeAgentOptions(max_turns=15),
320+
# Keeps the Task tools on models where Claude Code otherwise doesn't provide them.
321+
options=ClaudeAgentOptions(max_turns=15, env={"CLAUDE_CODE_ENABLE_TODO_TOOLS": "1"}),
300322
):
301323
if not isinstance(message, AssistantMessage):
302324
continue

docs/agent-sdk/typescript.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2520,7 +2520,17 @@ type TodoWriteInput = {
25202520
Creates and manages a structured task list for tracking progress.
25212521
25222522
<Note>
2523-
As of TypeScript Agent SDK 0.3.142, `TodoWrite` is disabled by default. Use `TaskCreate`, `TaskGet`, `TaskUpdate`, and `TaskList` instead. See [Migrate to Task tools](/docs/en/agent-sdk/todo-tracking#migrate-to-task-tools) to update your monitoring code, or set `CLAUDE_CODE_ENABLE_TASKS=0` to revert to `TodoWrite`.
2523+
On TypeScript Agent SDK 0.3.233 and later, the following tools aren't available on Opus 4.8, Sonnet 5, Fable 5, Mythos 5, or later versions of those families unless you opt in:
2524+
2525+
* `TodoWrite`
2526+
* `TaskCreate`
2527+
* `TaskGet`
2528+
* `TaskUpdate`
2529+
* `TaskList`
2530+
2531+
On other models, Claude Code provides the Task tools by default and `TodoWrite` only when you set `CLAUDE_CODE_ENABLE_TASKS=0`.
2532+
2533+
See [Model availability](/docs/en/agent-sdk/todo-tracking#model-availability) to opt in and [Migrate to Task tools](/docs/en/agent-sdk/todo-tracking#migrate-to-task-tools) to update your monitoring code.
25242534
</Note>
25252535
25262536
### TaskCreate
@@ -3435,7 +3445,17 @@ type TodoWriteOutput = {
34353445
Returns the previous and updated task lists.
34363446
34373447
<Note>
3438-
As of TypeScript Agent SDK 0.3.142, `TodoWrite` is disabled by default. Use `TaskCreate`, `TaskGet`, `TaskUpdate`, and `TaskList` instead. See [Migrate to Task tools](/docs/en/agent-sdk/todo-tracking#migrate-to-task-tools) to update your monitoring code, or set `CLAUDE_CODE_ENABLE_TASKS=0` to revert to `TodoWrite`.
3448+
On TypeScript Agent SDK 0.3.233 and later, the following tools aren't available on Opus 4.8, Sonnet 5, Fable 5, Mythos 5, or later versions of those families unless you opt in:
3449+
3450+
* `TodoWrite`
3451+
* `TaskCreate`
3452+
* `TaskGet`
3453+
* `TaskUpdate`
3454+
* `TaskList`
3455+
3456+
On other models, Claude Code provides the Task tools by default and `TodoWrite` only when you set `CLAUDE_CODE_ENABLE_TASKS=0`.
3457+
3458+
See [Model availability](/docs/en/agent-sdk/todo-tracking#model-availability) to opt in and [Migrate to Task tools](/docs/en/agent-sdk/todo-tracking#migrate-to-task-tools) to update your monitoring code.
34393459
</Note>
34403460
34413461
### TaskCreate

docs/agent-teams.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ Both agent teams and [subagents](/docs/en/sub-agents) let you parallelize work,
3939
<img src="https://mintcdn.com/claude-code/nsvRFSDNfpSU5nT7/images/subagents-vs-agent-teams-dark.png?fit=max&auto=format&n=nsvRFSDNfpSU5nT7&q=85&s=d573a037540f2ada6a9ae7d8285b46fd" className="hidden dark:block" alt="Diagram comparing subagent and agent team architectures. Subagents are spawned by the main agent, do work, and report results back. Agent teams coordinate through a shared task list, with teammates communicating directly with each other." width="4245" height="1615" data-path="images/subagents-vs-agent-teams-dark.png" />
4040
</Frame>
4141

42-
| | Subagents | Agent teams |
43-
| :---------------- | :----------------------------------------------- | :-------------------------------------------------- |
44-
| **Context** | Own context window; results return to the caller | Own context window; fully independent |
45-
| **Communication** | Report results back to the main agent only | Teammates message each other directly |
46-
| **Coordination** | Main agent manages all work | Shared task list with self-coordination |
47-
| **Best for** | Focused tasks where only the result matters | Complex work requiring discussion and collaboration |
48-
| **Token cost** | Lower: results summarized back to main context | Higher: each teammate is a separate Claude instance |
42+
| | Subagents | Agent teams |
43+
| :---------------- | :----------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------- |
44+
| **Context** | Own context window; results return to the caller | Own context window; fully independent |
45+
| **Communication** | Report results back to the main agent only | Teammates message each other directly |
46+
| **Coordination** | Main agent manages all work | Self-coordination through messages, plus a shared task list for [agents that have the Task tools](/docs/en/tools-reference#task-tool-availability) |
47+
| **Best for** | Focused tasks where only the result matters | Complex work requiring discussion and collaboration |
48+
| **Token cost** | Lower: results summarized back to main context | Higher: each teammate is a separate Claude instance |
4949

5050
Use 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.
5151

@@ -179,6 +179,8 @@ A teammate's model and fast mode are fixed when it spawns, so `/model` and `/fas
179179

180180
The 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.
181181

182+
Agents [without the Task tools](/docs/en/tools-reference#task-tool-availability) coordinate through messages instead of the shared task list.
183+
182184
The lead can assign tasks explicitly, or teammates can self-claim:
183185

184186
* **Lead assigns**: tell the lead which task to give to which teammate
@@ -258,7 +260,7 @@ To use a subagent definition, mention it by name when asking Claude to spawn the
258260
Spawn a teammate using the security-reviewer agent type to audit the auth module.
259261
```
260262

261-
The teammate honors that definition's `tools` allowlist and `model`, and the definition's body is appended to the teammate's system prompt as additional instructions rather than replacing it. Team coordination tools such as `SendMessage` and the task management tools are always available to a teammate even when `tools` restricts other tools.
263+
The teammate honors that definition's `tools` allowlist and `model`, and the definition's body is appended to the teammate's system prompt as additional instructions rather than replacing it. For an in-process teammate, Claude Code adds `SendMessage` to that allowlist. In a [session that has the Task tools](/docs/en/tools-reference#task-tool-availability), Claude Code adds `TaskCreate`, `TaskGet`, `TaskList`, and `TaskUpdate` to it too.
262264

263265
<Note>
264266
The `skills` and `mcpServers` frontmatter fields in a subagent definition are not applied when that definition runs as a teammate. Teammates load skills and MCP servers from your project and user settings, the same as a regular session.

0 commit comments

Comments
 (0)