All guides

Where is Codex's config.toml? Locations, layers and precedence

Updated 27 November 2026 · 5 min read

The Codex CLI's main config file is ~/.codex/config.toml in your home folder (on Windows, %USERPROFILE%\.codex\config.toml). If the CODEX_HOME environment variable is set, Codex uses that folder instead of ~/.codex. On top of the user file, Codex can load a .codex/config.toml inside your project (only when you trust the project), a profile file chosen with --profile, and one-off -c overrides on the command line. If a setting doesn't seem to apply, type /debug-config in Codex to see which layers are loaded.

01The user config file

OpenAI's config basics say: "Codex stores user-level configuration at ~/.codex/config.toml." It's plain TOML:

# ~/.codex/config.toml
model = "your-model"

[tui]
notifications = true

The same folder holds Codex's other local state. OpenAI's advanced config docs list config.toml, auth.json (if you use file-based credential storage), history.jsonl (if history is kept) and logs and caches. User-level hooks can live next to it in ~/.codex/hooks.json.

02CODEX_HOME

"Codex stores its local state under CODEX_HOME (defaults to ~/.codex)." Set it to keep a separate config, for example for a test setup:

CODEX_HOME=~/codex-test codex

Codex then reads config.toml, hooks.json and its other state from that folder. If your settings suddenly seem to vanish, check whether CODEX_HOME is set in your shell.

03Project config: .codex/config.toml

You can put a .codex/config.toml in a repository to set options for that project. Codex walks from the project root (by default the folder containing .git) down to your current folder and loads every .codex/config.toml it finds; where two define the same key, the one closest to your working folder wins.

These files load only for trusted projects. In OpenAI's words: "If the project is untrusted, Codex ignores project .codex/ layers, including .codex/config.toml, project-local hooks, and project-local rules." Trust is stored in your user config as trust_level under a [projects."<path>"] table, set to trusted or untrusted.

Some keys are never read from a project file, whatever the trust. Codex ignores notify, profile, profiles, model_provider, model_providers, otel and a few base URL settings there, and prints a warning at startup. Put notification, provider and telemetry settings in ~/.codex/config.toml.

04Profiles

A profile is a separate file next to the user config, named ~/.codex/<name>.config.toml. codex --profile deep-review loads ~/.codex/config.toml and then overlays ~/.codex/deep-review.config.toml. Use top-level keys in the profile file, not a [profiles.deep-review] table.

This changed in Codex 0.134.0: --profile no longer reads [profiles.<name>] tables from config.toml, and the top-level profile = "<name>" selector is no longer supported. If you have an older setup, move each table into its own file.

05Which setting wins

OpenAI lists the order, highest first:

  1. CLI flags and -c / --config overrides
  2. Project .codex/config.toml files, closest to your working folder first (trusted projects only)
  3. The profile file selected with --profile
  4. User config, ~/.codex/config.toml
  5. Cloud-managed defaults, when your signed-in workspace delivers them
  6. System config, /etc/codex/config.toml on Unix, if present
  7. Built-in defaults

One-off overrides are parsed as TOML and accept dot notation:

codex --config sandbox_workspace_write.network_access=true

If a setting still doesn't behave, /debug-config inside Codex shows the config layers and requirement sources it loaded. In a managed workspace, an administrator can also set requirements in a requirements.toml, which /debug-config shows as a source.

06Notification keys in config.toml

Three parts of the config control notifications. Each has its own guide:

  • notify runs a program of your choice after each turn, with a JSON description of the turn. It must be in the user config, not a project file. See the notify setting.
  • [tui] notifications: notifications, notification_method and notification_condition control Codex's built-in terminal alert for finished turns and waiting approvals. See Codex's built-in notifications.
  • Hooks can go inline under [hooks] in config.toml, or in hooks.json in the same folder. They need trusting once with /hooks. See Codex hooks explained.

And one keep-awake setting that matters for long runs: prevent_idle_sleep = true under [features] (experimental, off by default). See Codex with the laptop closed.

Start a new codex session after editing the file. If notifications still don't arrive, the troubleshooting guide goes through the usual causes.

07Where Notifier for Codex keeps its settings

Notifier for Codex, an independent tool not made by OpenAI, doesn't add anything to config.toml. Its free codex-notifier command for Mac, Windows and Linux installs its entries in ~/.codex/hooks.json and keeps its own options separately, which you change with codex-notifier config set. It sends finished turns, approvals and questions to its iPhone and Android app, where you can answer them.

08FAQ

Where is config.toml on Windows?

In the .codex folder in your user profile, %USERPROFILE%\.codex\config.toml, unless CODEX_HOME points somewhere else.

Why is my project's .codex/config.toml ignored?

Either the project isn't trusted, or the key is one Codex never reads from project files, such as notify or profile. Codex prints a warning at startup for ignored keys.

How do I see which config Codex is actually using?

Type /debug-config in a Codex session. It lists the config layers and requirement sources that are loaded.

Does [profiles.name] still work?

Not since Codex 0.134.0. Move the settings into ~/.codex/name.config.toml and select it with --profile name.

Notifier for Codex Get a push on your phone when Codex finishes or needs you, then approve, reject or answer from there. The codex-notifier command line tool is free on Mac, Windows and Linux.