Move Your Coding Agent's Project State Off the Chat Window: Markdown Task Contracts Fix Redo Loops and Hallucinations

Muted_Ad_9442 · reddit · 2026-09-16

The author kept hitting coding agents redoing finished work or "believing" tests passed because the chat history said so — the memory lived in the very context window that degrades. His fix: move project state entirely to disk as a Markdown plan file, where each row is a task contract with dependencies, a pre-written verify command, priority, done status, and validity score.

This yields four wins: context window limits stop mattering (a fresh session reads unchecked rows and picks up instantly); dependencies become a deterministic DAG instead of an instruction; verification is written before code generation, so the agent can't grade its own homework or rewrite tests to match buggy code; and handoffs become lossless — one model plans, another executes, an independent model validates.

The cost is spontaneity: exploratory prototyping must be converted into a plan row first. For complex refactors, the author finds the trade-off worth it.

Original post →

More from coding & agent

coding & agent channel →