Codex Manual
Config and Login
Most Codex config issues come from editing the wrong config.toml or setting environment variables in the wrong environment.
Common config paths:
| Environment | Config file |
|---|---|
| macOS / Linux | ~/.codex/config.toml |
| Windows native | %USERPROFILE%\.codex\config.toml |
| WSL2 | ~/.codex/config.toml inside WSL |
Windows native and WSL2 are separate environments.
Basic settings:
approval_policy = "on-request"
sandbox_mode = "workspace-write"
preferred_auth_method = "apikey"If CODEX_HOME is set, Codex uses that directory for configuration and state. Most users do not need to set it manually.
When config does not apply, check the current OS environment, config path, environment variables, CLI overrides, profiles, and whether the App or terminal needs a restart.