Why does Codex lose context in long chats?
When a chat fills its context window, Codex compacts the history to make room. Here’s how to keep the details.
Updated 18 October 2026
In Codex
Sources: slash commands, configuration, AGENTS.md, memories.
-
Watch the context
Type /status to see how much of the chat’s context is in use. Near the limit, Codex compacts the history on its own to make room.
-
Keep rules and key facts in AGENTS.md
Codex reads AGENTS.md before doing any work, each time it starts, so what’s there doesn’t depend on the chat.
-
Compact or start fresh when you choose
/compact compacts the chat now. /new starts a blank chat in the same workspace.
-
Turn on Codex memories
They carry details from past chats on the same computer. They’re off by default.
Or with SkyOS
SkyOS keeps each decision as its own exact, dated note, outside the chat. With the memory instructions on, Codex reads the notes before it answers, so early decisions stay in view however long the chat gets.
SkyOS saves as you chat, so connect it before your next long one. It works on Codex’s free plan.
Free while in beta. No card needed.