A patch-only prompt to stop agents re-reading full memory and burning credits after step 20

Designer-Material633 · reddit · 2026-12-02

The author shares a system prompt for multi-step agent builds that loop, forget context, and burn credits after step 20. The idea: agents pass patches, never full state. State lives in one versioned store; each step sends only stateid + what changed, capped at 800 tokens per patch (say OVER BUDGET if exceeded). Never loadall() — load only needed keys; return only {"patch": {...}}. On version conflicts, stop and say CONFLICT, re-read changed keys, get a fresh stateid, then write a new patch — otherwise the conflict guard becomes a loop.

Related event: A patch-only prompt stops agents from burning tokens rereading memory(2 posts)→

Original post →

More from coding & agent

coding & agent channel →