← WRITING

Tip: enable 1M context in Codex with one command

Run one command, let the script create a backup of ~/.codex/config.toml, patch the 1M settings if needed, then restart Codex.

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

  1. OpenAI GPT-5.4 model page
  2. Introducing GPT-5.4

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.

See you down the next rabbit hole.

More notes →

Start typing to follow a rabbit hole.

↵ open · Esc close