Context layout is a cost decision: one memory edit can bust your entire agent prompt cache

dscape · x · 2026-10-27

Engineer Fred Oliveira (@f) published months of harness design research arguing that context layout is fundamentally a cost decision. Agents resend the full context on every call — often dozens of calls per request — so changing one token near the top re-prices everything under it and busts the prompt cache. His diagram shows cache hits climbing per call (9/11, 11/13) then collapsing to 6/15 after a single memory edit. Takeaway: order instructions/tools/memory/conversation by change frequency, keeping volatile content at the tail to preserve prefix caching. Full thread in original post.

Original post →

More from coding & agent

coding & agent channel →