HeadsUpAI

OpenAI Adds Manual Context Compaction to Prevent Codex Memory Limits

· Updated

OpenAI added a manual /compact command to Codex, its terminal-based agentic coding tool. The feature allows users to trigger context compaction—summarizing conversation history into a condensed format—to free up space in the model's context window (the maximum amount of text a model can process at once).

As agentic coding moves toward long-running sessions involving deep debugging, context windows fill up quickly. When a window is full, models may lose track of earlier instructions. Manual compaction gives developers control over this memory, ensuring the agent retains essential goals without the noise of previous terminal outputs.

You can now issue the /compact command at any point during a Codex session, particularly before starting a new project phase. This clears the token backlog while the agent writes its current state to a scratchpad for continuity. The feature is available now within the Codex CLI environment.

Share this update