# How to check the context window in Codex: CLI, IDE extension and app

> Type /status, or read the context-left footer in the CLI. GPT-6.2 Sol defaults to 500,000 tokens in Codex and GPT-6.2 Astra to 272,000.

URL: https://claudegpt.si/news/codex-check-context-window  
Published: 2026-11-22T23:02:38.722Z  
Author: ClaudeGPT Si Newsroom  
Section: Guides  
Topics: Codex, OpenAI, Context window, AI coding tools  
Publisher: ClaudeGPT Si

## Key takeaways

- Type /status in any Codex chat: the CLI shows remaining context capacity, and the IDE extension and app show the chat ID, context usage and rate limits.
- The Codex CLI footer shows context left by default, and /statusline puts it back if your status line dropped it.
- As of November 22, 2026, GPT-6.2 Sol defaults to 500,000 tokens in Codex and GPT-6.2 Astra to 272,000, and both can go up to 1 million with model_context_window.

To check the context window in Codex, type `/status` in any chat. In the Codex CLI it reports the active model and how much context capacity is left, and in the IDE extension and the desktop app it shows the chat ID, context usage and rate limits. The CLI also keeps a "context left" readout in the footer under the prompt, as long as your status line includes it.

The context window is how many tokens the model can hold in one chat: your instructions, the files Codex has read, tool output and the conversation so far. As of November 22, 2026, OpenAI's [models page](https://learn.chatgpt.com/docs/models) lists a default of 500,000 tokens in Codex for GPT-6.2 Sol and 272,000 for GPT-6.2 Astra. This guide covers where to see how much is left on each surface, what Codex does when the window fills, and what you can do about it. Every step below comes from OpenAI's Codex docs and help center.

The context window is not your usage limit. Context belongs to one chat; the usage limit is your plan's allowance over hours and weeks. For the second one, see our guide on [how to see your Codex usage](https://claudegpt.si/news/codex-how-to-see-usage), and for how the two differ, [the Codex context window is not your usage limit](https://claudegpt.si/news/codex-context-window-vs-usage-limit).

## How to check the context window in the Codex CLI

The CLI gives you two places to look.

### 1. Read the footer under the prompt

OpenAI's [Codex CLI page](https://learn.chatgpt.com/docs/codex/cli) shows the terminal with "100% context left · ? for shortcuts" under the composer. That percentage starts at 100 in a new chat and falls as the chat grows.

The footer is configurable. According to OpenAI's [sample config](https://learn.chatgpt.com/docs/config-file/config-sample), when you haven't set anything Codex shows three items: `model-with-reasoning`, `context-remaining` and `current-dir`. If you, or an older config, changed the status line, the context item may be gone.

### 2. Put context back in the footer with /statusline

If you don't see a context readout:

1. Type `/statusline` in a chat.
2. In the picker, turn on the context item and move it where you want it. The [developer commands reference](https://learn.chatgpt.com/docs/developer-commands?surface=cli) lists "context stats" among the items, along with the model, rate limits, git branch, token counters and session ID.
3. Confirm. The footer updates at once, and Codex saves the choice to `tui.status_line` in `config.toml`.

You can also set it by hand. In `~/.codex/config.toml`:

```toml
[tui]
status_line = ["model-with-reasoning", "context-remaining", "current-dir"]
```

Setting the list to `[]` hides the footer, and the [config reference](https://learn.chatgpt.com/docs/config-file/config-reference) says `null` turns the status line off entirely, so check for either if the footer is blank.

### 3. Run /status for the full picture

Type `/status` and press Enter. OpenAI's reference describes it as a way to "confirm the active model, approval policy, writable roots, and remaining context capacity." It also shows token usage for the session. After `/status`, `/copy` copies the full output or a single field, which helps when you are reporting a problem.

## How to check context in the IDE extension and the desktop app

The Codex IDE extension and Codex in the desktop app (OpenAI's docs now file it under the ChatGPT desktop app), share one set of composer slash commands.

1. Click into the Codex composer and type `/`.
2. Pick `/status` from the list, or keep typing to filter, then press Enter.
3. Read the result. OpenAI's [slash commands reference](https://learn.chatgpt.com/docs/reference/slash-commands) says `/status` will "show the chat ID, context usage, and rate limits."

OpenAI's guide to [Codex remote work](https://developers.openai.com/blog/mastering-codex-remote-for-engineering) also mentions an optional context indicator that "keeps remaining context visible in the composer." The app and IDE docs don't say where to switch it on, so `/status` is the check that works everywhere.

## How big the Codex context window is

The size depends on the model you picked with `/model` or the model switcher. The figures below are from OpenAI's models page, as of November 22, 2026.

| Model | Default context in Codex | Can you raise it? |
| --- | --- | --- |
| GPT-6.2 Sol | 500,000 tokens | Yes, up to 1 million tokens |
| GPT-6.2 Astra | 272,000 tokens | Yes, up to 1 million tokens |
| GPT-6.1 Sol | 500,000 tokens | Not stated |
| GPT-6.1 Terra, GPT-6 Luna, GPT-6 Astra | Not listed on the models page | Not stated |

To use the longer window, OpenAI says to set `model_context_window` in `config.toml`, the file the desktop app, the CLI and the IDE extension all read:

```toml
model = "gpt-6.2-sol"
model_context_window = 1000000
```

A bigger window lets one chat hold more before it compacts. It doesn't make a long chat free: every turn sends that context back to the model.

### What we ran

We installed the CLI in a Linux VM with `npm install @openai/codex`, which gave `codex-cli 0.171.0`, the release OpenAI's [changelog](https://learn.chatgpt.com/docs/changelog?type=codex-cli) dates November 20, 2026. `codex --version` and `codex --help` run without an account. We didn't sign in, so we couldn't open a chat or show real `/status` output.

`codex debug models --bundled` also works offline. It prints the model catalog that ships inside the binary as JSON. In 0.171.0 the catalog gives `context_window` values that match the models page (500,000 for GPT-6.2 Sol and 272,000 for GPT-6.2 Astra), 500,000 for GPT-6.1 Terra and 272,000 for GPT-6 Luna and GPT-6 Astra. Every listed model carries an `effective_context_window_percent` of 95. The catalog's `max_context_window` for the GPT-6.2 models is 872,000 tokens, lower than the 1 million the models page gives, and Codex normally refreshes the catalog from OpenAI's remote models endpoint, so treat the models page as the reference.

## What happens when the context runs out

Codex doesn't simply stop. It compacts the chat: it replaces earlier turns with a summary, so the work can go on in the same chat. OpenAI's [best practices guide](https://learn.chatgpt.com/guides/best-practices) says Codex compacts chats automatically, and OpenAI's help center refers to the "Context automatically compacted" message Codex shows when it does.

You can control when that happens in `config.toml`. The config reference lists:

- `model_auto_compact_token_limit`: the token count that triggers automatic compaction. Left unset, Codex uses the model's default.
- `model_post_turn_compact_threshold_percent`: a number from 0 to 100. Codex compacts after a final response once the context reaches that share of the usable window, so it happens between tasks instead of during one. The sample config uses 80. Leave it out or set it to 0 to turn it off; the usual automatic compaction still applies.

```toml
model_post_turn_compact_threshold_percent = 80
```

## What to do when the context is nearly full

Check `/status`, then pick one of these, based on whether you are still on the same task.

1. **Same task, long chat: run `/compact`.** In the CLI, Codex asks you to confirm, then replaces earlier turns with a short summary. The same command works in the IDE extension and the app.
2. **New task: start a new chat.** In the CLI, `/new` starts a new chat inside the same session and `/clear` clears the terminal too. In the app, `/new` starts a blank chat in the same local workspace. In the IDE extension, the New chat command is Cmd+N on macOS and Ctrl+N on Windows and Linux.
3. **Different direction, same history: `/fork`.** It copies the chat into a new one, so you can branch off without filling the original.
4. **A side question: `/side`.** It starts a temporary side chat without interrupting the main one.
5. **Need more room on GPT-6.2: raise `model_context_window`.** See the table above.

To fill the window more slowly, OpenAI's best practices say to keep one chat per coherent unit of work and to point Codex at the files that matter with an @ mention. A chat used for an entire project, the guide warns, "leads to bloated context and worse results over time."

## When compaction keeps repeating

If Codex shows "Context automatically compacted" over and over without making progress, OpenAI's help article on [using Codex with your ChatGPT plan](https://help.openai.com/en/articles/11369540-using-codex-with-your-chatgpt-plan) says to stop the task and start a new Codex chat with a short summary of your goal and the work already done.

A new chat clears the context but, as the same article says, "does not reset your usage limits." Those run on their own timer. Our guide to [Codex free resets](https://claudegpt.si/news/codex-free-reset) explains the banked resets OpenAI sometimes hands out and how to redeem one with `/usage`.

## Frequently asked questions

### How do I see how much context is left in Codex?

Type /status in the chat. In the CLI you can also read the context-left percentage in the footer under the prompt, and add it back with /statusline if it is missing.

### What is the context window of Codex?

It depends on the model. OpenAI's models page lists a default of 500,000 tokens in Codex for GPT-6.2 Sol and 272,000 for GPT-6.2 Astra, and says both support up to 1 million tokens when you set model_context_window in config.toml.

### What does /compact do in Codex?

It replaces earlier turns of the current chat with a short summary, which frees context while keeping the key details. Codex also compacts automatically as a chat fills up.

### Does starting a new Codex chat reset my usage limit?

No. A new chat clears the context, but OpenAI's help center says starting a new chat does not reset your usage limits.

## Sources

- [Developer commands (CLI, IDE extension)](https://learn.chatgpt.com/docs/developer-commands?surface=cli), OpenAI
- [Slash commands in the ChatGPT desktop app](https://learn.chatgpt.com/docs/reference/slash-commands), OpenAI
- [Models](https://learn.chatgpt.com/docs/models), OpenAI
- [Codex CLI](https://learn.chatgpt.com/docs/codex/cli), OpenAI
- [Configuration reference](https://learn.chatgpt.com/docs/config-file/config-reference), OpenAI
- [Sample configuration](https://learn.chatgpt.com/docs/config-file/config-sample), OpenAI
- [Best practices](https://learn.chatgpt.com/guides/best-practices), OpenAI
- [Using Codex with your ChatGPT plan](https://help.openai.com/en/articles/11369540-using-codex-with-your-chatgpt-plan), OpenAI
- [ChatGPT and Codex changelog](https://learn.chatgpt.com/docs/changelog?type=codex-cli), OpenAI
- [Mastering remote engineering work from your phone](https://developers.openai.com/blog/mastering-codex-remote-for-engineering), OpenAI
