Codex's 1M Context Window Is Real — but OpenAI Won't Turn It On for You
Smart Market Insight Editorial
Editorial Team
This article may contain affiliate links. We only recommend tools we’ve personally tested. Read our full disclaimer.
On August 17, 2026, an OpenAI engineer on the Codex team publicly posted the exact config to unlock GPT-5.6 Sol's full 1-million-token context window inside Codex CLI — because, by default, OpenAI doesn't give it to you. Tibo Sottiaux, who works on Codex and ChatGPT, shared the three lines needed to override Codex's built-in cap. Within hours, OpenAI researcher Noam Brown replied that he doesn't actually recommend doing it.
That's an unusually candid public disagreement for a company shipping a headline spec, and it's worth understanding if you use Codex, or any AI coding agent, for real work. Here's what's actually capped, why OpenAI built it that way, and how it stacks up against Claude Code, which ships full context by default.
Quick Take
- What happened: OpenAI's own Codex engineer posted the config to raise Codex CLI's context window from its tuned default to the full 1,050,000 tokens GPT-5.6 Sol supports via the API.
- The catch: Codex CLI doesn't ship at 1M by default. Independent tracking and OpenAI's own GitHub repo show the working default has recently sat around 272,000 tokens — and has moved more than once in recent updates, including reports of it dropping further without notice.
- The disagreement: Sottiaux framed the override as a documented, common request. OpenAI researcher Noam Brown publicly said he doesn't recommend raising it, arguing the default is tuned for a reason.
- Why it matters: Anthropic's Claude Code already runs Claude Sonnet 5 at the full 1M context window unconditionally, with no config to edit — a real difference in how the two companies think about the tradeoff between context and cost.
What Sottiaux Actually Posted
In a post on X, Sottiaux gave Codex CLI users three lines to add to ~/.codex/config.toml: set the model to gpt-5.6-sol, set model_context_window = 1000000, and set model_auto_compact_token_limit = 900000 so Codex starts summarizing older conversation history before it hits the ceiling. He was explicit that this wasn't a new feature — GPT-5.6 Sol has supported a roughly 1.05-million-token context window via the API for a while. What changed is that OpenAI documented, for the first time in one place, how to get Codex's own CLI to actually use it.
He also said the quiet part out loud: Codex's default is "tuned to be set optimally when it comes to performance and cost" — company language for "we're limiting this on purpose, and it's cheaper for us this way."
Why the Default Sits Well Below 1M
The gap between GPT-5.6 Sol's advertised context and what Codex hands you by default has been a recurring irritant for Codex users this summer. Multiple GitHub issues on the openai/codex repository document the working ceiling sitting around 258,000–272,000 tokens in recent CLI builds, well under the million-token number OpenAI puts in its own model cards, and users have reported it moving between updates without a changelog entry calling it out.
That matters practically: Codex silently compacting or truncating context mid-session is what causes an agent to "forget" a file it edited ten minutes ago, or lose track of an earlier instruction in a long refactor. It's the single most common complaint in Codex's own issue tracker about long-running sessions — which is exactly the workload a bigger context window is supposed to fix.
Not Even OpenAI Agrees on the Fix
The most telling part of this story isn't the config snippet — it's that a senior OpenAI researcher pushed back on it in public, within hours. Brown's position, in short: more context isn't free. It costs more per call, slows responses as the model has to attend to more tokens, and — per research OpenAI and others have published on long-context performance — models don't always use a bigger window well; relevant details can still get lost in a sea of irrelevant ones ("context rot"), so a bigger window doesn't automatically mean a smarter agent.
Sottiaux's counter is also reasonable: it's one of the most-requested Codex settings there is, so document it and let people choose. Neither of them is wrong. It's a genuine engineering tradeoff, and OpenAI is now visibly split on which side of it Codex's defaults should sit on.
How This Compares to Claude Code and Cursor
This is where the comparison gets interesting for anyone choosing between agentic coding tools. Anthropic's Claude Code doesn't make you opt in to long context at all: Claude Sonnet 5 runs at its full 1M-token window unconditionally, and Claude Opus 5 gets the same 1M window on paid plans, both included at standard API pricing with no long-context surcharge, according to Anthropic's own documentation. That's a meaningfully different default philosophy than Codex's tuned-down-by-default approach — and it lines up with the flat-fee, less-metered posture we noted when GitHub Copilot's Visual Studio update shipped new features turned off specifically to manage token costs under usage-based billing.
| Tool | Advertised max context | Default in the CLI/editor |
|---|---|---|
| Codex CLI (GPT-5.6 Sol) | ~1.05M tokens | Capped well below that (~270K in recent builds), manual override needed |
| Claude Code (Sonnet 5) | 1M tokens | Full 1M by default, no config needed |
| Cursor | Up to 1M via "Max Mode" on supported models | Smaller default working window; Max Mode is an explicit opt-in per session |
Context window figures verified August 2026 from vendor documentation and public statements; confirm current defaults directly with each vendor, as these have shifted more than once this year.
Cursor's approach sits closer to OpenAI's than Anthropic's: it also treats maximum context as something you turn on deliberately (via Max Mode) rather than something every session gets by default, which tracks with Cursor's own usage-metered pricing on its Pro, Pro+, and Ultra plans.
Should You Turn It On?
If you're running Codex against a large, unfamiliar codebase — a big refactor, a bug that spans several files, or a long debugging session where you don't want Codex to lose the thread — raising model_context_window to 1,000,000 is a reasonable, reversible thing to try. It's a config file edit, not a subscription change, and you can set it back.
For short, well-scoped tasks — a single function, a small bug fix, a focused code review — leave the default alone. You'll get faster responses and lower token costs, and Brown's underlying point stands: more context a model doesn't need to use well is waste, not a free upgrade.
Frequently Asked Questions
Does GPT-5.6 Sol actually support a 1 million token context window? Yes, via the API and now via Amazon Bedrock. The issue is specifically that Codex CLI's default configuration doesn't pass the model that full window — it caps it lower for cost and performance reasons.
How do I enable the full context window in Codex CLI?
Add three lines to ~/.codex/config.toml: model = "gpt-5.6-sol", model_context_window = 1000000, and model_auto_compact_token_limit = 900000. This was documented publicly by OpenAI's Tibo Sottiaux on August 17, 2026.
Is this an official OpenAI feature launch? No. It's an existing model capability documented for Codex CLI users by an OpenAI engineer via a personal post, not a product announcement. OpenAI hasn't changed Codex's default behavior.
Does Claude Code have the same limitation? No — Claude Sonnet 5 runs at its full 1M-token context window by default inside Claude Code, with no configuration required, according to Anthropic's published documentation.
Will raising the context window make Codex more expensive? Potentially, yes, since you're sending and processing more tokens per request. It can also slow responses. That's the core of Noam Brown's objection to using it as a default.
Bottom Line
GPT-5.6 Sol's million-token context window was never fiction — it's just been fenced off inside Codex CLI by a default OpenAI tuned for cost and speed, not disclosed clearly until one of its own engineers spelled it out. Whether you should override that default depends entirely on the task in front of you, and notably, OpenAI's own researchers don't agree on the answer. If predictable, full-context-by-default behavior matters more to you than picking your model, that's currently a real point in Claude Code's favor. For the broader picture of how the major AI coding agents compare day to day, see our Cursor vs. GitHub Copilot vs. Claude Code breakdown, and for how OpenAI's pricing has moved around GPT-5.6 this quarter, read our coverage of the GPT-5.6 price cuts.
Related Articles
GitHub Copilot Ships a New AI Agent in Visual Studio, Off by Default
GitHub Copilot's new Visual Studio agent and built-in skills ship off by default — here's what changed and why the billing model explains it.
MCP's Biggest Spec Update Yet: What Changes for AI Agents in 2026
MCP's 2026-07-28 spec update makes the AI agent protocol stateless — here's what changed, what breaks, and why it matters for builders.
GitHub vs GitLab vs Bitbucket: Best Platform for Developers in 2026
GitHub vs GitLab vs Bitbucket compared on features, CI/CD, and pricing to find the best platform for developers in 2026.
Supabase vs Firebase vs PocketBase: Best Backend for Your Next Project
Supabase vs Firebase vs PocketBase compared on features, pricing, and developer experience for your next project.