Codex

How to check the Codex context window

How to check Codex context window size versus Codex usage windows. Context is the model's working memory. Usage windows are the quota that resets on a timer.

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

  1. Run codex in the repository you are working in.
  2. Type /status. The panel reports the active model, approval mode, and context usage.
  3. Type /context to see the breakdown if your version exposes it.
  4. Watch the number after large file reads or long tool output. Those move it fastest.
codex
/status
/context

The 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

ComponentTypical shareHow to reduce it
System and developer promptFixedNothing you can do
Repository instructionsSmall to mediumTrim AGENTS.md to the rules that matter
Conversation historyGrows every turnStart a new session for a new task
File reads and tool outputSpikyRead ranges instead of whole files
Attached screenshotsLarge per imageAttach 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 /status before 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.

Browse by topic