The core architectural technique enabling sustained agent sessions: automatically summarizing conversation history to prevent context window degradation as interactions grow. ## Core Concept OpenAI's Codex agent loop reveals the fundamental architecture underlying all coding agents: 1. **Send** user input + tool outputs to model 2. **Model responds** with actions or final message 3. **Tools execute** and return results 4. **Repeat** until assistant message ends the turn The critical innovation: as conversation history grows, the system **summarizes prior context** rather than sending the full transcript. Without this, agents degrade as conversations lengthen. Context windows fill with outdated details while losing access to recent, relevant information. ## Why This Matters - **Context window is finite**: Every agent has a maximum context; unsummarized histories hit limits quickly - **Relevance decay**: Early conversation turns become less relevant as work progresses - **Signal-to-noise**: Full transcripts dilute important context with routine tool outputs - **Cost**: Longer contexts = higher token costs per interaction ## Implementation Patterns - **Rolling summary**: Periodically compress older turns into concise summaries - **Hierarchical context**: Recent turns in full detail, older turns as summaries, earliest turns as bullet points - **Tool output compression**: Replace verbose tool outputs with key findings - **Persistent artifacts**: Move important context to files (CLAUDE.md, task lists) rather than keeping in conversation ## Cross-Domain Applications - **Knowledge Management**: Progressive Summarization (Tiago Forte) applies the same principle to notes - **Meeting Management**: Meeting minutes summarize discussion for future reference rather than full transcripts - **Software Documentation**: Architecture Decision Records capture decisions, not full deliberation ## Related Concepts - [[Design Bottleneck Inversion]] — Context management enables longer design sessions - [[Agent Loop Maturity Spectrum]] — Summarization is a maturity indicator - [[Pair Programming to Parallel Delegation Shift]] — Async agents especially need summarization for session handoffs ## Source [[Unrolling the Codex Agent Loop]] (OpenAI, January 2026) — https://openai.com/index/unrolling-the-codex-agent-loop/