Codex CLI reference - Config files
Codex CLI config files and locations
Codex CLI documents 18 config files, including ~/.codex/config.toml, .codex/config.toml and $CODEX_HOME/profile-name.config.toml. These are the files and directories Codex CLI reads its configuration from. Each row gives the docs' description, accepted values and an example where one is documented.
Last verified 7 official pagesFull Codex CLI reference
| Path | Description | Example |
|---|---|---|
~/.codex/config.toml | User-level configuration file; personal defaults live here. Precedence is below CLI flags, project config, and profile files. Docs: ~/.codex/config.toml | -no example |
.codex/config.toml | Project-scoped config overrides; Codex walks from the project root to the working directory and the closest file wins. Loaded only when the project is trusted. Docs: .codex/config.toml | -no example |
$CODEX_HOME/profile-name.config.toml | Profile file layered on top of the base user config when you pass | codex --profile deep-review |
/etc/codex/config.toml | System config on Unix (if present); ranks below user config and cloud-managed defaults, above built-in defaults. Docs: /etc/codex/config.toml | -no example |
requirements.toml | Admin-enforced configuration file that constrains security-sensitive settings users cannot override. Docs: requirements.toml | -no example |
$CODEX_HOME/auth.json | Stores credentials when you use file-based credential storage (otherwise the OS keychain/keyring is used). Docs: $CODEX_HOME/auth.json | -no example |
~/.codex/history.jsonl | Local session transcript history under CODEX_HOME when history persistence is enabled; configure with | -no example |
~/.codex/hooks.json | User-level lifecycle hooks file; hooks can also be defined inline as | -no example |
<repo>/.codex/hooks.json | Project-local lifecycle hooks; load only when the project | -no example |
~/.codex/AGENTS.md | Global guidance file in the Codex home directory, read before any work and inherited by every repository. Docs: ~/.codex/AGENTS.md | -no example |
~/.codex/AGENTS.override.md | Temporary global override read instead of | -no example |
AGENTS.md | Project instructions file; Codex walks from the project root to the working directory and includes at most one file per directory, checking | -no example |
AGENTS.override.md | Per-directory override checked before | -no example |
~/.codex/rules/default.rules | User-layer execpolicy rules file (Starlark | -no example |
<repo>/.codex/rules/ | Project-local | -no example |
$CODEX_HOME/themes | Place a | -no example |
codex-tui.log | Opt-in plaintext TUI log written to the directory set by | codex -c log_dir=./.codex-log |
CODEX_HOME/packages/standalone | Standalone package cache used by the standalone installer. Docs: CODEX_HOME/packages/standalone | -no example |
The rest of the Codex CLI reference
FAQ
How many config files does Codex CLI have?
The official Codex CLI docs list 18 config files, including ~/.codex/config.toml, .codex/config.toml and $CODEX_HOME/profile-name.config.toml. All of them are in the table above, in the docs' order.
What does ~/.codex/config.toml do in Codex CLI?
User-level configuration file; personal defaults live here. Precedence is below CLI flags, project config, and profile files.
Where are Codex CLI config files documented?
On 7 official docs pages at learn.chatgpt.com, last read on October 17, 2026. Every row in the table links the exact section it came from.
More on Codex CLI
- Codex CLI in the tools directoryWhat it is, who makes it and how it fits next to other coding agents.
- Codex CLI errors and fixes14 error messages, quoted verbatim, with the documented fix for each.
- Codex and ChatGPT usage limitsPlan and tier limits for this tool, copied from the official docs.
Use other models in Codex CLI
Setup guides from the model-in-tool directory, each with the env vars and base URL from official docs.
Sources
Last verified . Names and examples are copied verbatim from the 7 official pages below, and every row above links the exact section it came from.
- learn.chatgpt.com/docs/config-file/config-basic3 items
- learn.chatgpt.com/docs/config-file/config-advanced6 items
- learn.chatgpt.com/docs/config-file/config-reference1 item
- learn.chatgpt.com/docs/agent-configuration/agents-md4 items
- learn.chatgpt.com/docs/agent-configuration/rules2 items
- learn.chatgpt.com/docs/cli-customization1 item
- learn.chatgpt.com/docs/config-file/environment-variables1 item
Newsletter
Know when your tools change
One email per week. New coding agent releases, the flags and commands they add, and what they mean for how you work.