Context management and compaction
Added 2026-07-14 · Last verified 2026-07-14
Manage context as a budget: retain the system policy, current objective, unresolved constraints, recent actions, exact error messages, and identifiers needed for future tool calls, while dropping duplicated prose and superseded attempts. A sliding window preserves local conversational detail, whereas periodic summaries compress older history; summaries should separate verified facts from hypotheses and link to durable artifacts rather than paraphrasing critical code or numbers. Trigger compaction before the window is full and test that an agent can resume from the compacted state without losing commitments or repeating side effects.
Related notes
Source: The Agent Loop — agent-loop.xyz. Curated in the open knowledge base (CC BY 4.0).