Monday, August 17, 2026Story 2 of 3
The official three settings that unlock a 1M-token context window in Codex
A perennial power-user request just got an official answer. Tibo (@thsottiaux), who leads Codex development at OpenAI, published the procedure for enabling a one-million-token context window in Codex on Sunday (US time). GPT-5.6 Sol has a documented 1,050,000-token context window, but Codex deliberately caps its default below that for performance and cost. "This is a common ask, so here it is documented," he wrote.
Confidence in this AI-assisted summary High

Key points
- The procedure is three lines. In ~/.codex/config.toml, at the top level before any [section] headers, add: model = "gpt-5.6-sol", model_context_window = 1000000, and model_auto_compact_token_limit = 900000. The third setting starts automatic history compaction around 900,000 tokens, leaving headroom. Save, restart the Codex client, and start a new session. To try it once without changing your defaults, pass the same values as -c flags on the CLI: codex -m gpt-5.6-sol -c model_context_window=1000000 -c model_auto_compact_token_limit=900000.
- What changes: a larger window lets Codex retain more code, tool output, and conversation history before it starts summarizing older material. That pays off in repository-wide refactors and long investigation sessions where context loss hurts. The cost is real, though - more input tokens per request means higher bills and potentially slower responses. The post closes with "Have fun, but also know that we tuned the default carefully!" - positioning this as a switch for the days you need it, not a new default.
- Million-token context windows are one of this summer's battlegrounds. Qwen3.8, covered in our August 15 issue, extends 262K to 1M via YaRN, and the Gemini line sells 1M windows as a headline feature. Around Codex specifically, the cadence has been volume plays - usage-limit resets, a permanent price cut, the 14x-speed Ultrafast mode - and now the memory dial. One footnote: the day before, the same lead posted an essay arguing that per-token price comparisons across models are meaningless, because tokenizers differ and a million tokens does not hold the same amount of information from one model to the next.
Why it matters
Commentary
This is immediately usable, so the first question is where it actually helps. My read: everyday coding is fine on the default. The setting earns its cost in sessions where you want the agent to hold an entire repository in its head for hours - large migrations, refactors that span modules, incident investigations that chew through logs. Running it for small tasks just inflates your input bill. Flip the switch on the days that need it.
What deserves attention is that the official recipe ships with the compaction threshold (900,000 tokens) as a set. A bigger window is not automatically better: anyone who has run long sessions knows that stuffing context to the limit dilutes the instructions that matter. "Open the window to a million, but start compacting at nine hundred thousand" is operational wisdom, not a benchmark number. If you run your own agent setups, the headroom philosophy is worth copying wholesale.
And don't skim past "we tuned the default carefully." In a market where vendors compete on context-window size, OpenAI chose to cap Codex's default and hand out the unlock as documentation. Catalog specs and daily-driver defaults are different things - and when they diverge, the default is usually closer to the practical answer. That's a lesson that generalizes well beyond Codex.