Skip to content
IFAI

AI tools

OpenAI Codex lets you unlock a 1M token context

Published Reach 41

OpenAI Codex now lets users manually unlock a 1-million-token context window when using GPT-5.6 Sol. By tweaking three lines in the config file or passing CLI flags, developers can stop Codex from prematurely summarizing large codebases and tool outputs. Why it matters: massive projects stay intact in memory, though OpenAI warns its tighter defaults exist for cost and speed reasons.

OpenAI Codex lets you unlock a 1M token context
Image: openai.com

If you use OpenAI Codex on sprawling codebases, you know the frustration of watching critical tool outputs and earlier context vanish into a summary just when you need them most.

OpenAI team member thsottiaux shared how to unlock a full 1M-token context window in Codex using GPT-5.6 Sol, a model with a documented ceiling of 1,050,000 tokens.

Three lines in your config file

To turn it on globally, open ~/.codex/config.toml and set model to gpt-5.6-sol, model_context_window to 1000000, and model_auto_compact_token_limit to 900000 before any section headers. Then restart your client.

That last setting triggers history compaction around 900,000 tokens, leaving enough buffer for incoming responses. If you only need it for a heavy debugging run, you can also pass those exact flags directly into a single CLI session without changing your global defaults.

OpenAI made sure to add a caveat: Codex defaults are deliberately tuned for optimal speed and API cost, so use the massive window knowing what you are trading off.

Why it matters

For engineers refactoring legacy monorepos or tracing bugs across dozens of files, a million tokens means Codex can ingest the whole problem space without losing the plot halfway through.

Still, we do not think this should become your daily driver. Blasting hundreds of thousands of tokens per prompt will hit your wallet and response latency hard. OpenAI was smart to keep this behind a manual config flag, making it a specialized power tool rather than an expensive default trap.

Sources (1)

  1. [1]
    x.com(opens in a new tab)Originalx.com

Best of AI, daily