The useful bits
- 1M context is not enabled by default in Codex.
- You can enable it with a one-line installer that backs up `~/.codex/config.toml` first.
- The script detects missing, partial, outdated, and already-correct configs and applies the smallest safe change.
if you want the fast path, run this:
curl -fsSL https://yigitkonur.com/enable-codex-1m-context.sh | bash
the script creates a timestamped backup of ~/.codex/config.toml, checks whether your config is missing, partial, outdated, or already correct, and then applies the smallest update that gets you to the 1M settings.
if you want to do it manually instead, add these two lines to ~/.codex/config.toml:
model_context_window = 1000000
model_auto_compact_token_limit = 900000
then restart Codex.
that’s it. no long context-window theory, just the switch you need.
OpenAI’s March 5, 2026 GPT-5.4 launch post says Codex has experimental support for the 1M window, and the GPT-5.4 model page lists a 1,050,000-token context window. the practical part is simply enabling it in your local config.
Sources & further reading
Questions & answers
Is 1M context enabled by default in Codex?
No. If you want Codex to use the larger GPT-5.4 window, you need to add the config values manually.
Can I do this with one command?
Yes. Run the installer one-liner from the post. It creates a timestamped backup first, updates the config only if needed, and leaves already-correct configs alone.