Why Coding Agents Lose Their Plan (and How a Todo Tool Fixes It)
Our agent can run commands, read files, write files, and edit code — all chained together automatically within a single prompt. Ask it to scaffold a module with three source files and a config, and...

Source: DEV Community
Our agent can run commands, read files, write files, and edit code — all chained together automatically within a single prompt. Ask it to scaffold a module with three source files and a config, and it'll happily bash and write_file its way through the whole thing. But ask it to refactor a codebase in ten steps, and something interesting happens: it nails steps one through three, starts to drift around step five, and by step seven it's improvising. The plan it had at the beginning has faded into the growing sea of tool calls and results filling the context window. This is a well-known property of language models called instruction-following decay. As a conversation grows longer, the system prompt and the original intent carry less weight relative to the mass of recent content. The model doesn't forget in the human sense — it just pays less attention. For a coding agent doing multi-step work, that's a serious problem. The plan has no durable representation — it lives only in the model's