
Four harness mechanisms—offloading at 20K tokens, structured compaction, todo recitation, persistent memory—keep long-horizon agents on-goal across 50+ tool calls.
September 13, 2026
brightray analysis
Summary
Agent harnesses prevent context overflow and goal loss through four layered mechanisms: offloading large tool results to disk (Deep Agents triggers at 20K tokens, evicts old edits at 85% window fill), structured compaction that explicitly names what to preserve, todo-list recitation that rewrites task goals into recent attention every few turns, and persistent memory injected from disk after resets. Evidence across LangChain Deep Agents, Claude Code, Manus, and Amazon AgentCore shows these patterns work in practice, though todo-state is not universally beneficial—Deep Agents v0.7 made it opt-in after evals showed mixed results—and persistent context files add 20–23% inference cost per an ETH Zurich study.
Why it matters
- Deep Agents offloads tool results >20K tokens to disk and evicts old edits at 85% window fill before falling back to summarization—offloading comes first.
- Compaction must name what it keeps: Deep Agents added structured fields (session intent, next steps) after forced-summarization experiments showed they improved performance.
- Todo recitation keeps goals in recent attention by rewriting a task list each turn, but Deep Agents v0.7 evals across 3 task categories showed slightly better reward and lower cost with todos off—making it opt-in.
- Persistent memory reloads after every reset but carries a real cost: ETH Zurich measured 20–23% higher inference cost from LLM-generated context files.
- Subagent delegation is a budgeting pattern: a research subagent burns tens of thousands of tokens exploring but returns a 1–2K token summary, keeping the parent window lean.
Community notes—
No notes yet — be the first.
See every signal in the Feed