Codex context window cut to 272K: why that number

Codex context window size fell from 372K to 272K

Codex is the coding agent from OpenAI that reads a repository, edits files and runs commands for you. With this change, the three GPT-5.6 models inside it lost 100,000 tokens of configured window each. Both the raw setting and the part a session can really use went down.

Codex context window for GPT-5.6, before and after July 18, 2026 (tokens)

Configured window

The value written in models.json. Bar height is relative to 372,000 = 100.

372,000Before
272,000After

Usable after 5% headroom

What a session can fill before compaction. Same scale as the configured-window chart.

353,400Before
258,400After

The cut came as a one-file GitHub change with no notice

PR #33972 carries the edit. Titled "Backport refreshed bundled model metadata to 0.144," it was merged into the Codex 0.144 release branch on July 18, 2026.

OpenAI posted nothing on its blog or in release notes, so the change first surfaced among developers who read the diff. Only one file changes: models.json, where the entries for GPT-5.6 Sol, Terra and Luna get both context_window and max_context_window rewritten from 372,000 to 272,000.

The 272,000 figure is not new for Codex. In the same file, GPT-5.4 and GPT-5.2 already carry a 272,000-token window, so the GPT-5.6 models are back in line with the generations before them.

- "context_window": 372000, - "max_context_window": 372000, + "context_window": 272000, + "max_context_window": 272000, — from the models.json diff, where the same four lines appear in each of the three GPT-5.6 entries
View official source →

Codex's 5% headroom puts the usable limit near 258K

Codex does not let a session fill the whole configured window. Issue #32486 notes that the model metadata applies a 95% effective-context multiplier, so 5% of the window is held back.

Before the cut, that gave an effective window of about 353,400 tokens. Applying the same 95% to 272,000 gives about 258,400, so the room a session can really use shrank by roughly 95,000 tokens.

The current model metadata reports a 372,000-token context window with a 95% effective-context multiplier, yielding an effective window of approximately 353,400 tokens. — from the issue body, written against Codex CLI 0.144.0
View official source →

Past 272K input, Codex usage limits run out faster

The new number sits exactly on a pricing line. GPT-5.6 Sol moves to a higher rate once input passes 272K tokens, and the old default let sessions cross that point without warning.

GPT-5.6 Sol billing on either side of 272K input tokens

272K input tokens or fewer
Standard input and output rates
More than 272K input tokens
2x input and 1.5x output, applied to the whole request
Old Codex default (usable)
About 353,400 tokens, past the line
New Codex default (usable)
About 258,400 tokens, 13,600 below the line

The whole request is billed at 2x input past 272K

OpenAI's model page for GPT-5.6 Sol says that a prompt with more than 272K input tokens is billed at 2x the input rate and 1.5x the output rate. The higher rate covers the full request, not only the tokens above the line, so one prompt that goes a little over costs about twice as much on the input side.

On an API key, the difference shows up on the bill. For people signed in with a ChatGPT plan, Issue #32486 calls the same line a "higher-usage" threshold: each request past it uses up the allowance faster.

Prompts with >272K input tokens are priced at 2x input and 1.5x output for the full request. — from the pricing section of the model page
View official source →

The old 372K default could run 81,400 tokens past 272K

Issue #32486 lays out the arithmetic. With a usable window of about 353,400 tokens, a default session could run about 81,400 tokens into the higher band without the user ever choosing a larger context. The report adds that subagents, which Sol can launch to check its own work, add context the user did not ask for.

The workaround it offered was to set model_auto_compact_token_limit = 270000 so that Codex compacts before the line. After the cut, the default already does that: 258,400 usable tokens sit 13,600 below 272,000.

That means the default effective context can extend roughly 81K tokens into the higher-cost band: — from the issue body, before the per-number breakdown
View official source →

A smaller Codex token limit means earlier compaction

For small fixes, 258,400 usable tokens leaves plenty of room. The difference shows up in long sessions on large repositories, and in work that needs a very large context in one go.

GPT-5.6 context window: API vs Codex (tokens)

Bar height is relative to the API's 1,050,000 = 100. Orange marks the current Codex setting.

1,050,000GPT-5.6 Sol via the API
372,000Codex before July 18
272,000Codex now

Codex compaction kicks in sooner on large repositories

Compaction is what Codex does when the window fills: it replaces older turns with a summary to free up room. With 95,000 fewer usable tokens, that point arrives earlier in a session.

Each pass has a cost. Writing the summary takes model time, files read earlier may have to be read again, and details from early in the session survive only as far as the summary kept them. Work that loads many files at once, or runs for hours on one task, feels this first.

The GPT-5.6 context window in the API is still 1.05M

The 272K cap is a Codex setting, not a limit of the model. OpenAI's page for GPT-5.6 Sol still lists a 1,050,000-token context window with 128,000 max output tokens.

Codex itself can go higher too. PR #39102, merged on August 17, 2026 and shipped in Codex CLI 0.149.0, lets you override the window for the three GPT-5.6 models with model_context_window in config.toml, up to 872,000 tokens. The default is still 272,000, and a request over 272K input is billed at the higher rate whichever route you take.

Allow gpt-5.6-sol , gpt-5.6-terra , and gpt-5.6-luna context-window overrides up to 872,000 tokens. — from the pull request description
View official source →
1,050,000 context window — from the model specifications
View official source →

Keep Codex sessions small while the cap stays at 272K

The limit is lower, but it now keeps default sessions out of the higher-priced band. A few habits help you get more work out of each session.

Three ways to work within the 272K Codex context window

  1. Point Codex at the files a task needs instead of the whole repository
  2. Start a fresh session for each task rather than stretching one for hours
  3. Raise model_context_window (up to 872K) or use the API only when a job needs more than 272K and the 2x rate is worth it

Scoping comes first, because every file Codex reads stays in the window until compaction. For measurements of how much an agent loads before you even type, see Claude Code Token Usage: 33K vs OpenCode's 7K.

Primary sources such as Codex PRs and issues are easier for an AI to read when you convert the page to Markdown first. The AI then gets the headings, tables and code blocks as structure instead of raw HTML.

FAQ

What is the Codex context window now?
272,000 tokens for GPT-5.6 Sol, Terra and Luna. PR #33972, merged on July 18, 2026, lowered both the context window and the maximum context window from 372,000. Codex holds back 5% as headroom, so a session can actually use about 258,400 tokens before compaction starts.
Does going past 272K tokens cost more?
Yes. For GPT-5.6 Sol, OpenAI bills any prompt over 272K input tokens at 2x the input rate and 1.5x the output rate, and the higher rate covers the whole request, not only the tokens above the line. On an API key, that shows up on the bill; on a ChatGPT plan it uses up your allowance faster.
Can I still get a bigger GPT-5.6 context window?
Yes, in Codex as well as the API. Codex still defaults to 272,000, but PR #39102, merged on August 17, 2026, lets you raise model_context_window in config.toml to as much as 872,000 tokens for GPT-5.6 Sol, Terra and Luna. The API lists 1,050,000. Either way, input over 272K is billed at the higher rate.