**TodoWriteTool: To-Do List**
8/2/2026, 2:50:28 PM · Source
AI-translated on 8/2/2026, 2:51:24 PM · by Qwen3.6 35B (fast, default)
`TodoWriteTool` est un outil de gestion de tâches léger dans Claude Code qui suit explicitement les travaux au niveau de la session via des mises à jour de l'AppState, nettoie automatiquement les tâches terminées et déclenche des invites de vérification pour les flux de travail complexes.
It's not an ordinary checklist, but making in-session tasks explicit
TodoWriteTool is Claude Code's classic lightweight task management tool.
Its purpose isn't to replace a formal task system, but to allow the model to break down work into a visible sequence of todos within the current session.
You can think of it as:
TodoWriteTool: Lightweight, in-session, quick trackingTaskCreateToolseries: Structured, formal task system
Key Source Code
tools/TodoWriteTool/TodoWriteTool.ts:
const inputSchema = z.strictObject({
todos: TodoListSchema().describe('The updated todo list'),
})
The actual state write-back is:
context.setAppState(prev => ({
...prev,
todos: {
...prev.todos,
[todoKey]: newTodos,
},
}))
This shows that it's essentially an AppState writing tool.
Call Chain
Model splits current work > TodoWriteTool > Updates AppState.todos > UI displays checklist > Model proceeds to next step according to the list
Implementation Highlights
It has two interesting design features:
- When all todos are completed, the list is directly cleared
- If finishing a complex task with more than 3 items and containing no verification step, it prompts to generate a verification nudge
This part of the source code is crucial:
if (
allDone &&
todos.length >= 3 &&
!todos.some(t => /verif/i.test(t.content))
) {
verificationNudgeNeeded = true
}
This shows it doesn't just "write lists," but also pushes for more rigorous verification when wrapping up a task.
A Typical Usage Path
- The user provides a medium-complexity task
- The model first writes 3-5 todos
- After completing each item, the state is updated
- When closing the final item, if no verification is present, it's reminded to add one
Its Relationship with Adjacent Tools
TodoWriteTool > Lightweight in-session task tracking
TaskCreate/Update/List > Formal task system
Summary
The value of TodoWriteTool is:
Make the model's current plan explicit at minimum cost, and integrate process constraints like "clear the list when done, don't forget verification for complex tasks" into the session state.
Learning map
Application Ability Cultivation
- Foundation Level: Understand the core concept of task decomposition, master practical approaches for lightweight tracking and session state management
- Intermediate Level: Use
TodoWriteToolto implement dynamic task view construction and state management logic - Advanced Level: Integrate todo tools into complex workflows and adopt systematic thinking for adding verification mechanisms at critical checkpoints
Get hands-on — step by step
- Environment preparation: Ensure Claude Code is deployed and has a development environment ready.
- Create TodoWriteTool instance:
import { TodoWriteTool } from 'claudes-code/tools'; const todoTool = new TodoWriteTool(); - Task creation and maintenance:
- Call
todoTool.addTask('Implement UI') - After completing each item, call
todoTool.complete('UI Task')
- Call
- Completion verification prompt settings:
- Modify the configuration so the tool does not automatically clean up when completing 5+ tasks
- Add custom validation conditions
- Verification flow testing: Execute a complete task flow and observe when todos disappear and verification prompts are triggered
Top 3 sources
- 1
- 2
- 3
Links are AI-suggested — worth a quick sanity check before diving in.