Codex config.toml skill for Codex
Every setting in the right layer, verified. Codex locates every configuration layer in play, reads effective values with /debug-config, and edits the user, project or profile file that should own each setting. It validates with --strict-config, catches TOML scoping mistakes, and replaces retired settings such as approval_policy untrusted and [profiles] tables that can break startup after an upgrade.
curl -fsSL codexskills.dev/install.sh \ | sh -s -- codex-config-toml Installs to ~/.agents/skills/codex-config-toml/ for every project on this machine.
curl -fsSL codexskills.dev/cli.mjs -o codex-skills.mjsnode codex-skills.mjs install codex-config-toml The CLI also searches, updates and removes skills. Run it with no arguments to pick from a list. Needs Node 20.12+.
curl -fsSL codexskills.dev/install.sh \ | sh -s -- --project codex-config-toml Installs to .agents/skills/codex-config-toml/ in the current repository. Commit it and everyone who runs Codex there gets it.
curl -fsSLO codexskills.dev/downloads/codex-config-toml.zipunzip -o codex-config-toml.zip -d ~/.agents/skills/ The archive holds the skill folder with its generated agents/openai.yaml. Unzip into .agents/skills/ to scope it to a repo.
& ([scriptblock]::Create((irm codexskills.dev/install.ps1))) codex-config-toml PowerShell 5.1 or 7. Installs to %USERPROFILE%\.agents\skills\. Add -Project for the current repo.
104-line POSIX script. No sudo, no telemetry. Read install.sh
Use it in Codex
Start a prompt with $codex-config-toml, or pick it from /skills.
You can also just describe the task: Codex reads the description below and loads the playbook when your request matches.
What Codex reads before loading it
Edits and debugs Codex configuration in ~/.codex/config.toml and project .codex/config.toml, covering model and model_reasoning_effort, approval_policy, sandbox_mode, web_search, shell_environment_policy, history, project trust, feature flags and one-off -c overrides, with layer precedence and the keys project files ignore. Use when setting up Codex defaults, when a setting seems to have no effect, when Codex fails to start after an upgrade, or when a user asks how to configure codex config.toml.
Use it when
- Setting up Codex defaults on a new machine
- A config value appears to have no effect
- Codex errors at startup after an upgrade
- Deciding between user, project and one-off -c settings
Use something else when
- You need several named presets for different tasks: use codex-profiles
- The question is which sandbox and approval policy fit a task: use codex-sandbox-approvals
How to check the result
Run Codex with --strict-config so unknown keys fail, then check /debug-config to confirm each changed value comes from the intended layer.
The mistake it prevents
Writing a top-level key such as model after a [table] header, so TOML silently scopes it to that table and Codex ignores it.
Done well means: each setting lives in the right layer, the file parses under
--strict-config, /debug-config shows the value coming from the layer you expect, and
no retired keys remain that can stop Codex from starting.
Layers and precedence (highest first)
| # | Layer | Notes |
|---|---|---|
| 1 | CLI flags and -c key=value / --config | One run only |
| 2 | Project .codex/config.toml, root down to cwd, closest wins | Loaded only for trusted projects |
| 3 | Profile file ~/.codex/<name>.config.toml via --profile <name> | See codex-profiles |
| 4 | User ~/.codex/config.toml | CODEX_HOME moves the whole directory |
| 5 | Cloud-managed defaults for the signed-in workspace | |
| 6 | System /etc/codex/config.toml (Unix) | |
| 7 | Built-in defaults |
Separate from these, admin requirements.toml constrains what any layer may set (for
example forbidding approval_policy = "never"). A value can be “set” and still be
rejected by requirements; /debug-config shows both.
Project .codex/config.toml cannot set credential, provider or machine-local keys. Codex
ignores these there and warns at startup: openai_base_url, chatgpt_base_url,
model_provider, model_providers, notify, profile, profiles, otel,
apps_mcp_product_sku, experimental_realtime_ws_base_url. Put them in the user file.
Workflow
- [ ] 1. Find which files are in play
- [ ] 2. Read current values and their sources
- [ ] 3. Edit the right layer
- [ ] 4. Validate strictly and confirm the effective value
- Locate files:
echo "${CODEX_HOME:-$HOME/.codex}", then check that directory’sconfig.toml, any*.config.tomlprofile files, the repo’s.codex/config.toml, and/etc/codex/config.toml. - In the TUI run
/debug-config(layer order, lowest precedence first, plus policy sources) and/status(active model, approval policy, writable roots, context). Outside the TUI,codex features listshows feature flags with effective state andcodex doctorchecks install, config and auth health. - Edit. Personal defaults go in the user file; settings the whole team needs for this repo (MCP servers, fallback filenames, agent roles) go in the project file; per-task variants go in profile files.
- Validate:
codex --strict-config(TUI) orcodex exec --strict-config --ephemeral "ok"errors on keys this version does not recognize. Then re-check/debug-config.
A sane user config
# ~/.codex/config.toml
# Top-level keys MUST come before the first [table] header.
model = "gpt-6.1-sol" # pick one that /model lists for your account
model_reasoning_effort = "medium" # levels depend on the model: low, medium, high, xhigh, max, ultra
plan_mode_reasoning_effort = "high"
approval_policy = "on-request" # on-request | never | { granular = { ... } }
sandbox_mode = "workspace-write" # read-only | workspace-write | danger-full-access
web_search = "cached" # cached (default) | indexed | live | disabled
file_opener = "vscode" # vscode | vscode-insiders | cursor | windsurf | none
project_doc_max_bytes = 32768
[sandbox_workspace_write]
network_access = false # flip per task with -c, not globally
writable_roots = [] # extra dirs; prefer --add-dir per run
[shell_environment_policy]
inherit = "core" # all | core | none
ignore_default_excludes = false # drop vars whose names contain KEY, SECRET or TOKEN
[shell_environment_policy.filters]
"AWS_*" = "exclude"
[history]
persistence = "save-all" # or "none"
max_bytes = 104857600
[tui]
notifications = ["agent-turn-complete", "approval-requested"]
[projects."/Users/me/src/third-party-repo"]
trust_level = "untrusted" # skips that repo's .codex/ config, hooks and rules
Key reference for the settings people reach for most:
| Need | Key |
|---|---|
Different model only for /review | review_model |
| Shorter answers | model_verbosity = "low" |
| Hide reasoning summaries | model_reasoning_summary = "none" or hide_agent_reasoning = true |
| Point the built-in OpenAI provider at a proxy | openai_base_url (user layer only) |
| Extra instructions for every session | developer_instructions = """...""" |
| Alternate AGENTS.md names | project_doc_fallback_filenames = ["TEAM_GUIDE.md"] |
| Treat another marker as repo root | project_root_markers = [".git", ".hg"] |
| Desktop or webhook ping when a turn ends | notify = ["python3", "/abs/path/notify.py"] (user layer only) |
| Write a readable TUI log | log_dir = "/abs/path" |
| Skill catalog budget | skills.max_context_tokens (max 10000) |
| Disable one skill | [[skills.config]] with path and enabled = false |
| Toggle a feature | [features] table, or codex features enable <name> |
For MCP servers use codex-mcp-servers; for sandbox, network and approval trade-offs use
codex-sandbox-approvals; for named presets use codex-profiles.
One-off overrides
codex -m gpt-6.1-sol # dedicated flag beats -c when one exists
codex -c model_reasoning_effort='"high"'
codex -c sandbox_workspace_write.network_access=true
codex -c 'shell_environment_policy.include_only=["PATH","HOME"]'
codex -c mcp_servers.context7.enabled=false
codex exec --ignore-user-config --sandbox read-only "..." # reproducible CI run, auth still from CODEX_HOME
Values are parsed as TOML; anything that fails to parse is taken as a string. Quote the
whole key=value for the shell when it contains spaces, brackets or braces.
Retired settings that break or silently do nothing
| Found in config | Status | Replace with |
|---|---|---|
approval_policy = "untrusted" | Retired; can prevent Codex from starting | on-request, or [projects."<path>"] trust_level = "untrusted" for per-repo strictness |
[profiles.<name>] tables and profile = "<name>" | Ignored since 0.134.0 | ~/.codex/<name>.config.toml + --profile <name> |
--full-auto in scripts | Removed | --sandbox workspace-write |
Custom prompts in ~/.codex/prompts/ | Deprecated | Skills with allow_implicit_invocation: false |
personality = "friendly" or "pragmatic" | No effect | Remove, or personality = "none" |
features.web_search, web_search_request, web_search_cached | Deprecated | top-level web_search |
[model_providers.openai] | Not allowed (built-in id) | openai_base_url |
sandbox_mode plus default_permissions together | sandbox_mode wins; profiles ignored | Pick one model (see codex-sandbox-approvals) |
Gotchas
- TOML scoping: a key written after
[tui]belongs totui. A misplacedmodel = ...under a table is the classic “setting has no effect” bug.--strict-configreports it as an unknown key with file and line. - Project config is skipped for untrusted projects, with no error. If a repo’s
.codex/config.toml“does nothing”, check trust in/debug-config. - Relative paths inside a project config resolve from that
.codex/folder, not the cwd. ignore_default_excludesdefaults totrue, meaning variables likeGITHUB_TOKENARE passed to commands Codex runs unless you set it tofalseor filter them.CODEX_HOMEset in a shell profile or CI job points Codex at a different config, auth and history. Echo it before debugging anything.codex features enablewrites to$CODEX_HOME/config.toml; thefeaturessubcommand does not accept--profile.- Never commit a project config containing
mcp_servers.<id>.oauth.client_secretor bearer tokens; usebearer_token_env_varand environment variables.
Output contract
**Changed:** ~/.codex/config.toml (model_reasoning_effort medium -> high; removed [profiles.ci])
**Created:** ~/.codex/ci.config.toml
**Validated:** `codex exec --strict-config --ephemeral "ok"` exits 0; /debug-config shows effort from user layer
**Notes:** approval_policy "untrusted" removed; repo marked trust_level = "untrusted" instead What the zip contains
SKILL.md plus the interface file below. Nothing runs on install.
agents/openai.yaml
Gives the Codex app a display name, a one-line description and a starter prompt for this skill.
interface:
display_name: "Codex config.toml"
short_description: "Every setting in the right layer, verified"
default_prompt: "$codex-config-toml Set up my ~/.codex/config.toml with sensible defaults for daily work" About this skill
Written and maintained by the Codex Skills editors to the same editorial standard as every skill here: a selective description, a real workflow, known pitfalls and a way to verify the work. First published , last updated . MIT licensed. Something wrong or out of date? Tell us.