Learning resourcesReviewed · Anthropic

Track todos in the Claude Agent SDK

This guide teaches developers to show task progress in Claude Agent SDK apps, but some models require task tools to be explicitly enabled. It provides TypeScript and Python examples for logging task activity and maintaining a progress display.

Researched 14 Nov 2026

In short.

This guide helps developers add task logs and progress displays to Claude Agent SDK applications, but tool availability depends on the model and Claude Code version. Its main implementation detail is matching task creation calls with their results to obtain assigned task IDs. It also explains environment settings, inconsistent streamed field names and turn-limit errors. The examples were not executed, and the page does not establish costs or licensing terms.

Researched and written by an AI model and checked by a second AI model. How it works

Covers the complete Track todos page at [https://code.claude.com/docs/en/agent-sdk/todo-tracking.md], including model and version notices, the todo lifecycle, both TypeScript and Python example pairs, and the related-documentation references. Contents of linked pages are excluded. Installation, example execution, actual session behavior, performance and production reliability were not assessed.

The overview

Resource identity

Track todos is a Claude Code documentation guide about observing task activity through the Claude Agent SDK. It teaches an application integration pattern rather than supplying a standalone progress dashboard. The source address is [https://code.claude.com/docs/en/agent-sdk/todo-tracking.md].

Practical assessment

The guide is useful when an application needs to record Claude's task activity or display its written task list. It distinguishes a simple event log from a tracker that preserves task identity across updates. The page says newer models can perform multi-step work without written todos, so enabling these tools primarily serves applications that consume their events.

The examples explain an integration pattern, but runtime correctness and production suitability are not assessed.

Who it suits

The intended readers are TypeScript and Python developers building applications around Claude Agent SDK sessions. Beginners get a task lifecycle and complete example structures, but need enough programming knowledge to follow asynchronous message loops and tool events. Experienced developers get specific details about task IDs, structured results, executable overrides and differences between streamed inputs and executed inputs.

It offers limited value to someone using Claude without building an application that reads SDK messages.

What the guide teaches

The examples monitor TaskCreate and TaskUpdate calls to log new tasks, maintain task state, count completed and active items, and display an activeForm label while work is in progress. The documented lifecycle uses pending, in_progress and completed states, with deletion requested through TaskUpdate using status: "deleted".

The page also identifies TaskList for reading the task list and TaskGet for retrieving one task's details. These are described capabilities, not features demonstrated by the progress display itself.

Using it

Requirements and compatibility

The examples require the Claude Agent SDK; installation is delegated to a linked quickstart whose contents are outside this page. Authentication, runtime versions and hardware requirements are not specified here.

The documented defaults apply to Claude Code v2.1.268 and later, bundled by the TypeScript Agent SDK from v0.3.268. Task tools are available by default on Claude Opus 4.7, Claude Sonnet 4.6, Claude Haiku 4.5 and earlier models. Other models, including model IDs Claude Code does not recognize, require opt-in. No corresponding minimum Python SDK version is stated.

Using pathToClaudeCodeExecutable in TypeScript or cli_path in Python selects a separate Claude Code installation, whose own tool defaults then apply.

How tracking works

Todo activity appears as tool_use blocks inside assistant messages. The task notification message types discussed on the page concern background commands and subagents, rather than todo updates.

A TaskCreate input does not contain its assigned task ID. The tracker remembers the creation call, matches a later tool_result through tool_use_id, and reads task.id from the containing user message's tool_use_result field. That ID connects subsequent updates to the task.

Streamed inputs retain the model's original field names even when Claude Code repairs them before execution. The examples therefore accept taskId, id or task_id for an update, and activeForm or active_form for its activity label.

Setup choices

The page gives three ways to enable tracking tools when they are absent by default: name a tracking tool in allowedTools or allowed_tools, include the desired tools in the tools option, or set CLAUDE_CODE_ENABLE_TODO_TOOLS=1 through env. The tools option restricts the session's built-in tools to those named, so other tools the application needs must also be included.

In TypeScript, env replaces the subprocess environment; the examples spread process.env to preserve inherited variables. Python merges env with the inherited environment.

The samples use acceptEdits, which automatically approves file edits produced by the requested project work. Alternative permission modes are referenced but not explained on this page.

Examples provided

The logging example asks Claude to create a static website and allows 15 turns. It prints task subjects and status updates, but does not capture assigned IDs for creation entries, so those entries cannot be matched to later updates.

The display example asks for an authentication system and allows 20 turns. Its TaskTracker maintains a task map, records successful creation results, removes deleted tasks and rerenders a console summary.

The examples use single-shot query calls. The page explains that reaching the turn limit produces an error_max_turns result before query raises an error. The samples catch errors and log them; they do not demonstrate retry or recovery.

Assessment & evidence

Limitations

Claude may skip todos for short requests, and sessions without tracking tools produce no tracking tool_use blocks. A missing progress display therefore does not establish that work has stopped.

The display is driven by task events rather than independent checks of the underlying project. In particular, the tracker applies status changes from TaskUpdate inputs without waiting for their execution results. This means its displayed status should not be treated as independently verified completion.

Setting CLAUDE_CODE_ENABLE_TASKS=0 substitutes TodoWrite for the four Task tools. The supplied listeners handle TaskCreate and TaskUpdate, so they would need adaptation for TodoWrite.

Why the implementation details matter

Matching creation calls with successful results matters because a task subject alone cannot reliably identify later updates. Reading alternate field names matters because the application sees raw streamed input rather than Claude Code's repaired input.

Together, these details make the stateful example more useful for a persistent display than the simple logger. That is an assessment of the documented design; the page supplies no benchmark or comparative reliability measurements.

Alternatives described

For basic activity records, the page offers a logger instead of a stateful progress display. For applications that need task identity and current status, it offers TaskTracker.

On newer models, applications that do not consume task events can leave written task tracking disabled. TodoWrite is another documented tool configuration, but its event handling is not demonstrated. Competing SDKs and external progress libraries are not assessed.

Evidence and confidence

The evidence is the complete documentation page at [https://code.claude.com/docs/en/agent-sdk/todo-tracking.md], including both language versions of its examples and its compatibility notices. It supports descriptions of the documented interface and example design. It contains no independent test results or performance measurements, and the examples were not executed.

Access & freshness

Costs

The page provides no model prices, SDK charges, token usage measurements or operating-cost estimates. The cost of running either example is unknown. Turn limits constrain the examples' agent loops, but the page does not translate them into spending limits.

Licensing and reuse

The supplied page contains no explicit license or reuse grant for its documentation or example code. Commercial reuse, modification and redistribution rights are therefore unknown from this evidence. SDK and service terms are not established by the page.

Version and date limits

The supplied page was captured on 14 November 2026 at 22:30:32 UTC. Its model availability claims are tied to the stated Claude Code and TypeScript SDK version thresholds. The page's publication and last-update dates are unknown, and changes after capture are not assessed. An application's actual tool availability also depends on the Claude Code executable it uses.

How to apply the guide

First decide whether the application needs a task log or a display that maintains current task state. Confirm which tracking tools the actual session exposes, enable them if needed, and use the corresponding event handlers.

For a stateful display, retain call-to-result matching, accept the documented alternate field names, and distinguish task status from verified project outcomes. Account for acceptEdits before using the sample prompts, and inspect final result subtypes to distinguish successful completion from a turn-limit ending.

Evidence for this report

selected-page.txtselected · checked 2026-11-14