Quick answer
In the Codex CLI, type `/status` to see how much of the model's context window the current session is using. `/context` breaks the same number into system prompt, instructions, conversation, and tool output where your build supports it. When the window fills, Codex compacts or starts dropping older turns.
Check context usage
- Run
codexin the repository you are working in. - Type
/status. The panel reports the active model, approval mode, and context usage. - Type
/contextto see the breakdown if your version exposes it. - Watch the number after large file reads or long tool output. Those move it fastest.
codex
/status
/contextThe IDE extension shows the same conversation in a different frame. There is no separate context budget: the panel and the extension are two views of one session.
What fills the window
| Component | Typical share | How to reduce it |
|---|---|---|
| System and developer prompt | Fixed | Nothing you can do |
| Repository instructions | Small to medium | Trim AGENTS.md to the rules that matter |
| Conversation history | Grows every turn | Start a new session for a new task |
| File reads and tool output | Spiky | Read ranges instead of whole files |
| Attached screenshots | Large per image | Attach only when the image is the question |
A context window is not the same as a usage window. The context window is the model's working memory for one conversation; the usage window is the provider's allowance over time. The Codex weekly vs 5-hour limit guide covers how the usage windows work.
What happens when it fills
Codex compacts the conversation when it approaches the limit, replacing older turns with a summary. Compaction keeps the session alive but loses detail, which is why answers sometimes get vaguer late in a long run.
- Start a fresh session per task instead of one all-day thread.
- Ask for a short written summary before switching tasks, then paste it into the new session.
- Keep AGENTS.md focused on conventions, not history.
- Use
/statusbefore a large refactor so you know how much room is left.
If context fills unusually fast, check the session log for repeated file reads. A loop that re-reads the same directory will consume the window without producing progress.
Questions, answered
What is the Codex context window size?
It depends on the model selected for the session. The CLI reports the effective window for the active model in /status, which is more reliable than a fixed number.
Does context usage count against my Codex limit?
Yes, indirectly. Every turn resends context, so a full window costs more input tokens per request. That consumption draws on the same 5-hour and weekly windows.
Why does context usage drop without me clearing it?
Codex compacts older turns automatically near the limit. The drop is the summary replacing the original messages.