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.

  • Codex Mastery
  • $codex-config-toml
  • 162 lines
  • 2 files
  • ~2,000 tokens
  • MIT
  • Updated

Install

curl -fsSL codexskills.dev/install.sh \  | sh -s -- codex-config-toml

Installs to ~/.agents/skills/codex-config-toml/ for every project on this machine.

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

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.

~/.agents/skills/codex-config-toml/SKILL.md

--- name: codex-config-toml description: Edits and debugs Codex configuration in ~/.codex/config.toml and project .codex/config.toml, covering model and model_reasoning_effort,… license: MIT ---

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)

#LayerNotes
1CLI flags and -c key=value / --configOne run only
2Project .codex/config.toml, root down to cwd, closest winsLoaded only for trusted projects
3Profile file ~/.codex/<name>.config.toml via --profile <name>See codex-profiles
4User ~/.codex/config.tomlCODEX_HOME moves the whole directory
5Cloud-managed defaults for the signed-in workspace
6System /etc/codex/config.toml (Unix)
7Built-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
  1. Locate files: echo "${CODEX_HOME:-$HOME/.codex}", then check that directory’s config.toml, any *.config.toml profile files, the repo’s .codex/config.toml, and /etc/codex/config.toml.
  2. 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 list shows feature flags with effective state and codex doctor checks install, config and auth health.
  3. 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.
  4. Validate: codex --strict-config (TUI) or codex 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:

NeedKey
Different model only for /reviewreview_model
Shorter answersmodel_verbosity = "low"
Hide reasoning summariesmodel_reasoning_summary = "none" or hide_agent_reasoning = true
Point the built-in OpenAI provider at a proxyopenai_base_url (user layer only)
Extra instructions for every sessiondeveloper_instructions = """..."""
Alternate AGENTS.md namesproject_doc_fallback_filenames = ["TEAM_GUIDE.md"]
Treat another marker as repo rootproject_root_markers = [".git", ".hg"]
Desktop or webhook ping when a turn endsnotify = ["python3", "/abs/path/notify.py"] (user layer only)
Write a readable TUI loglog_dir = "/abs/path"
Skill catalog budgetskills.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 configStatusReplace with
approval_policy = "untrusted"Retired; can prevent Codex from startingon-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 scriptsRemoved--sandbox workspace-write
Custom prompts in ~/.codex/prompts/DeprecatedSkills with allow_implicit_invocation: false
personality = "friendly" or "pragmatic"No effectRemove, or personality = "none"
features.web_search, web_search_request, web_search_cachedDeprecatedtop-level web_search
[model_providers.openai]Not allowed (built-in id)openai_base_url
sandbox_mode plus default_permissions togethersandbox_mode wins; profiles ignoredPick one model (see codex-sandbox-approvals)

Gotchas

  • TOML scoping: a key written after [tui] belongs to tui. A misplaced model = ... under a table is the classic “setting has no effect” bug. --strict-config reports 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_excludes defaults to true, meaning variables like GITHUB_TOKEN ARE passed to commands Codex runs unless you set it to false or filter them.
  • CODEX_HOME set in a shell profile or CI job points Codex at a different config, auth and history. Echo it before debugging anything.
  • codex features enable writes to $CODEX_HOME/config.toml; the features subcommand does not accept --profile.
  • Never commit a project config containing mcp_servers.<id>.oauth.client_secret or bearer tokens; use bearer_token_env_var and 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.yamlgenerated from this page

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.

esc
Just launched

Codex Skills Pro is live

79 premium skills for Codex, each with scripts, references and an evidence report that proves the result.

Bought one by one$882.21
All 79 skills$49
94% off

That's $0.62 a skill, paid once.

Get all 79 for $49Or pick single skills from $4.99 →

Secure checkout by Creem