Find and edit the config file
configuration
// what it does
Codex reads settings from ~/.codex/config.toml, a TOML file covering model, reasoning effort, sandbox, approvals, MCP servers, and TUI look. Relocate the whole directory — which also holds auth.json, sessions/, and logs — by setting the CODEX_HOME environment variable; it defaults to ~/.codex.
// shell
$ cat ~/.codex/config.toml$ CODEX_HOME=~/work/.codex codex// gotcha
CODEX_HOME points at the directory, not the file — set it to a folder and Codex looks for config.toml, auth.json, and sessions/ inside it. On Windows the default path is %USERPROFILE%\.codex.