Long-Running Agent Memory: Avoid Auto-Compaction
repligate · x · 2026-08-06
For long-running agents, automatic context compaction often leads to severe performance degradation. Research indicates that errors in the initial summary are magnified by subsequent compactions, and models struggle to self-correct them.
Best engineering practices include:
- Avoid Small Models: Using smaller models like Claude Haiku for summarization yields poor results; switching to larger models like Opus offers massive improvements.
- Use .md Memory Files: For extremely long tasks, it's better to have the agent periodically edit a memory system of .md files combined with a rolling context.
- Periodic Fresh Starts: To optimize prompt caching, it is sometimes better to start completely fresh, re-reading only the .md memories.
More from coding & agent
- Dev uses Kanban board to manage multiple Claude Code sessions, says it offers better control than subagents — _rchaves_ · 2026-08-06
- Hermes Agent Integrates Actual Computer: Run Agents on Local Compute — markjeffrey · 2026-08-06
- Boosting Cursor CLI Startup Time by 25% Using Node.js Compile Cache — DanielLockyer · 2026-08-06
- Control Lighting Console with opencode: 'Make That Beam Red' — m4rkmc · 2026-08-06
- Hark Builds Digital Humanoid Agent That Can Navigate the Web Like a Human — adcock_brett · 2026-08-06
- Hermes Desktop Integrates Hindsight Memory Provider — max_paperclips · 2026-08-06