Persistent settings affect later Codex sessions as well as the current task. A one-run configuration override lets you try a different value without editing the configuration files those sessions will read.
Codex gives CLI flags and --config overrides priority over project, profile, user, cloud-managed, system, and built-in defaults. Dotted keys target nested TOML tables, and override values use TOML types rather than JSON syntax.
Dedicated launch flags are clearer when Codex already exposes one for the setting being changed, such as a model or approval-policy change. The generic override is useful for other keys and exact config.toml values. Organization requirements still constrain security-sensitive settings; a command-line override does not bypass them.
Each override is one key=value shell argument. A string needs TOML double quotes inside shell quotes, as in 'model_reasoning_effort="low"'. A second setting takes another --config key=value argument. A value that cannot be parsed as TOML falls back to a raw string, which may then fail the setting's type check.
Steps to override Codex configuration for a single run:
- List the current feature states.
$ codex features list ##### snipped ##### memories stable false ##### snipped #####
The last column is the effective boolean state for this command. Feature names, maturity labels, and defaults can vary by version and configuration. The output shown uses Codex CLI 0.166.0 with memories initially disabled.
- Override one feature with the -c shorthand and a dotted key.
$ codex -c features.memories=true features list ##### snipped ##### memories stable true ##### snipped #####
features.memories is the nested key for the memories feature, and the unquoted true is a TOML boolean. -c is shorthand for --config; the long form is --config features.memories=true. If your baseline is already true, features.memories=false makes the temporary change visible instead. Listing features loads the override without starting a model conversation or writing the feature setting to disk.
- Re-run the baseline command without --config.
$ codex features list ##### snipped ##### memories stable false ##### snipped #####
The feature state should match the first listing, including true if that was your original baseline. The one-run override has ended, and later runs still read the existing configuration files.