Why Coding Agents Lose Their Plan (and How a Todo Tool Fixes It)

TL;DR AI
2 min readKey summary
Language models lose focus on initial plans as conversation history grows, a phenomenon called instruction-following decay.
A coding agent stores its plan only in transient reasoning, causing multi-step tasks to drift as context expands.
The solution is a Todo tool: a TodoManager that holds up to 20 items with statuses and validates updates.
The agent's todo handler parses JSON into TodoItem objects, updates the manager, and returns a rendered task list so the model sees the current plan in context.
