Working Memory via Task Tracking
Keeps an explicit task list with status, blockers, and next steps during the session so agent and user can track progress
Add to Pack
Saved locally in this browser for now.
Cite This Pattern
Nikola Balic (@nibzard) (2026). Working Memory via Task Tracking. In *Awesome Agentic Patterns*. Retrieved October 14, 2026, from https://agentic-patterns.com/patterns/working-memory-via-todos
@misc{agentic_patterns_working-memory-via-todos,
title = {Working Memory via Task Tracking},
author = {Nikola Balic (@nibzard)},
year = {2026},
howpublished = {\url{https://agentic-patterns.com/patterns/working-memory-via-todos}},
note = {Awesome Agentic Patterns}
} Use when
- Complex multi-step tasks with dependencies
- Agent forgets or repeats tasks after context switches
- Several work streams run in the same session
Avoid when
- Simple single-step tasks
- Tasks that finish in seconds or quick questions
Problem
During complex multi-step tasks, AI agents lose track of:
- What tasks are pending, in progress, or completed
- Which tasks are blocked by dependencies
- Verification steps that need to run
- Next actions after context switches
This leads to redundant work, forgotten tasks, and confused users.
Solution
Use session task-tracking tools (in Claude Code: TaskCreate, TaskGet, TaskUpdate, and TaskList; earlier versions exposed a single TodoWrite tool) to maintain explicit working memory throughout the session. This serves as both agent and user visibility into session state.
Theoretical foundation: Externalizes working memory per Baddeley's episodic buffer model and Miller's 7±2 capacity limit—humans and LLMs both struggle to track more than a handful of items internally.
What to track:
- Task status: pending, in_progress, completed
- Blocking relationships: What blocks what
- Verification steps: Tests or checks needed
- Next actions: What to do next
Usage patterns from the author's session analysis (self-reported; the repository that hosted the analysis is no longer online, so treat the table as anecdotal):
| Project | Task-list uses | Session quality |
|---|---|---|
| nibzard-web | 52 | High (8 positive, 2 corrections) |
| awesome-agentic-patterns | 60 | Medium (1 positive, 5 corrections) |
| marginshot | 36 | No feedback captured |
| 2025-intro-swe | 0 | Simple work, no need |
Key insights:
- In that (unverifiable) analysis, task-list use accompanied smoother sessions; this is an observation, not a controlled result
- It serves as working memory for both agent and user
- Essential for complex multi-step tasks
- Less critical for simple, straightforward work
Current tooling note: since Claude Code v2.1.268 (Agent SDK v0.3.268), newer models track multi-step work without a written todo list, so todo tools are opt-in (CLAUDE_CODE_ENABLE_TODO_TOOLS=1), mainly to render progress for the user; the legacy TodoWrite tool remains only as a fallback (CLAUDE_CODE_ENABLE_TASKS=0). The underlying practice — externalizing task state for long-horizon work — is still recommended in Anthropic's context engineering guidance.
How to use it
When to use:
- Working on complex multi-step tasks
- Need to track blocked tasks and dependencies
- Want to maintain session state across operations
- Multiple parallel work streams
Implementation approach:
- Create tasks proactively: When you identify work, create a task entry
- Update status as you go: Mark tasks in_progress when starting
- Maintain single active task: Exactly ONE task should be in_progress at a time
- Document dependencies: Use
blocks/blockedByrelationships - Mark complete when done: Only mark tasks completed when truly finished
- Keep descriptions clear: Include enough context for future reference
Example workflow:
1. User: "Add OAuth login and fix the search bug"
2. Agent creates 2 tasks with the task-tracking tool
3. Agent marks OAuth task in_progress, starts work
4. Agent realizes OAuth needs database schema change
5. Agent blocks OAuth task, creates schema task
6. Agent completes schema, unblocks OAuth
7. Agent completes OAuth, moves to search bug
8. Agent completes search, marks all done
Anti-pattern prevention:
- Prevents context loss across context window switches
- Prevents redundant work (doing same task twice)
- Prevents forgotten tasks (user asks "what about X?")
- Prevents unclear session state
Trade-offs
Pros:
- Explicit session state for agent and user
- Dependency tracking prevents blocked work
- Progress visibility builds confidence
- Survives context window switches
- Reduces "what about X?" questions from users
Cons:
- Overhead for simple tasks
- Requires discipline to maintain
- Can become cluttered if overused
- May feel bureaucratic for quick one-offs
When NOT to use:
- Simple, single-step tasks
- Tasks that complete in seconds
- When user just wants quick answers
References
- Effective context engineering for AI agents (Anthropic) — recommends agentic memory such as notes and todo lists for long-horizon tasks, including Claude Code's to-do list
- Todo tracking (Claude Agent SDK docs) — current behavior: task-tracking tools by model, opt-in flags, and the
TodoWritelegacy fallback (replaces the deaddocs.anthropic.comtask-lists page) - Original evidence base: the author's 88-session Claude analysis (
github.com/nibzard/SKILLS-AGENTIC-LESSONS) is no longer available (HTTP 404), so the usage table above cannot be independently verified - Related patterns: Proactive Agent State Externalization, Filesystem-Based Agent State
- Baddeley, A. (2000). "The Episodic Buffer: A New Component of Working Memory?" Trends in Cognitive Sciences, 4(11), 417-423.
- Miller, G. A. (1956). "The Magical Number Seven, Plus or Minus Two." Psychological Review, 63(2), 81-97.