Primary navigation

Basic Configuration

Learn the basics of configuring your local Codex client

Codex reads local settings from ~/.codex/config.toml. Use this file to change defaults (like the model), set approval and sandbox behavior, and configure MCP servers.

Codex configuration file

Codex stores its configuration at ~/.codex/config.toml.

To open the configuration file from the Codex IDE extension, select the gear icon in the top-right corner, then select Codex Settings > Open config.toml.

The CLI and IDE extension share the same config.toml file. You can use it to:

Configuration precedence

Codex resolves values in this order:

  1. CLI flags (for example, --model)
  2. Profile values (from --profile <name>)
  3. Root-level values in config.toml
  4. Built-in defaults

Use that precedence to set shared defaults at the top level and keep profiles focused on the values that differ.

Common configuration options

Here are a few options people change most often:

Default model

Choose the model Codex uses by default in the CLI and IDE.

model = "gpt-5.2"

Approval prompts

Control when Codex pauses to ask before running generated commands.

approval_policy = "on-request"

Sandbox level

Adjust how much filesystem and network access Codex has while executing commands.

sandbox_mode = "workspace-write"

Reasoning effort

Tune how much reasoning effort the model applies when supported.

model_reasoning_effort = "high"

Command environment

Restrict or expand which environment variables are forwarded to spawned commands.

[shell_environment_policy]
include_only = ["PATH", "HOME"]

Feature flags

Optional and experimental capabilities are toggled via the [features] table in config.toml.

[features]
shell_snapshot = true           # Speed up repeated commands
web_search_request = true       # Allow the model to request web searches

Supported features

KeyDefaultMaturityDescription
apply_patch_freeformfalseExperimentalInclude the freeform apply_patch tool
elevated_windows_sandboxfalseExperimentalUse the elevated Windows sandbox pipeline
exec_policytrueExperimentalEnforce exec policy checks for shell/unified_exec
experimental_windows_sandboxfalseExperimentalUse the Windows restricted-token sandbox
paralleltrueStableAllow models that support it to call multiple tools in parallel
remote_compactiontrueExperimentalEnable remote compaction (ChatGPT auth only)
remote_modelsfalseExperimentalRefresh remote model list before showing readiness
shell_snapshotfalseBetaSnapshot your shell environment to speed up repeated commands
shell_tooltrueStableEnable the default shell tool
skillstrueExperimentalEnable discovery and injection of skills
unified_execfalseBetaUse the unified PTY-backed exec tool
undotrueStableEnable undo via per-turn git ghost snapshots
view_image_tooltrueStableInclude the view_image tool
warningstrueStableSend tool-usage warnings to the model
web_search_requestfalseStableAllow the model to issue web searches

The Maturity column uses feature maturity labels such as Experimental, Beta, and Stable. See Feature Maturity for how to interpret these labels.

Omit feature keys to keep their defaults.

Enabling features quickly

  • In config.toml, add feature_name = true under [features].
  • From the CLI, run codex --enable feature_name.
  • To enable multiple features, run codex --enable feature_a --enable feature_b.
  • To disable a feature, set the key to false in config.toml.