Desktop app says elastic section minimums must sum to DEFAULT_MAX_INPUT_TOKENS (128000), got 126000 (or 130000)? That one is not a TOML mistake: see the fix.
Fix it
- Open the file the error names. User config is
~/.codex/config.toml(Windows:%USERPROFILE%\.codex\config.toml). If you setCODEX_HOME, it is in that folder instead. A project can also have.codex/config.toml, loaded only for trusted projects. - Go to the line and column in the message and fix the TOML there (common slips below).
- If the message mentions a legacy profile, move the profile into its own file (section below).
- Check the result:
codex doctordiagnoses the installation, config, auth and runtime health. - If the file is damaged beyond repair, back it up, rename it, and start Codex again; then re-add your settings one block at a time.
What the error looks like
Error loading config.toml:
C:\Users\you\.codex\config.toml:1:7: key with no value, expected '='
The numbers after the path are line and column. Recent versions also print the source line with a caret under the problem, and exit immediately (as reported in issue #52848 on v0.162.1).
Common TOML mistakes
- A key with no value (
badkeyalone on a line): every key needs= value. - Unquoted text:
approval_policy = on-requestmust beapproval_policy = "on-request". - The same key or table twice: the TOML spec forbids defining a key more than once, which often happens after pasting a block from a README.
- Windows paths in double quotes: backslashes start escapes in basic strings. Use single quotes (
'C:\tools\server.exe') or double the backslashes.
A valid minimal file looks like this:
approval_policy = "on-request"
sandbox_mode = "workspace-write"
model_reasoning_effort = "medium"
"legacy profile config is no longer supported"
From Codex 0.134.0, --profile no longer reads [profiles.<name>] tables from config.toml. A leftover selector stops startup with:
legacy `profile = "work"` config is no longer supported; use `--profile work` with `work.config.toml` instead
To migrate (issue #24858 documents the same steps):
- Back up
~/.codex/config.toml. - Move the settings from
[profiles.work]to the top level of a new file,~/.codex/work.config.toml. - Delete the
[profiles.work]table and theprofile = "work"line fromconfig.toml. - Run
codex --profile work(orcodex exec --profile work "...").
Profile names can contain letters, numbers, hyphens and underscores.
The file got corrupted after a crash
Several reports (issue #54723 and others) describe config.toml becoming unreadable after a blue screen or power loss, with errors at a high column number on line 1. If the file is mostly empty bytes, there is nothing to repair: rename it, start Codex on its built-in defaults, and restore your settings from a backup.
Errors from -c / --config
Values passed with -c are parsed as TOML, so strings need TOML quotes inside shell quotes, and dots set nested keys:
codex --config model='"<model-name>"'
codex --config sandbox_workspace_write.network_access=true
codex --config 'shell_environment_policy.include_only=["PATH","HOME"]'
If a value can't be parsed as TOML, Codex treats it as a string.
Settings ignored without an error
- Precedence, highest first: CLI flags and
--config, project.codex/config.toml(trusted projects only), the--profilefile, user config, cloud-managed defaults, system config (/etc/codex/config.tomlon Unix), built-in defaults. - Some keys, such as
model_provider,model_providers,notifyandprofile, are ignored in a project's.codex/config.toml, with a startup warning. - To catch misspelled keys, start with
--strict-config: Codex then errors whenconfig.tomlcontains fields this version doesn't recognize.
Running Claude Code, Codex or Cursor on real repos, or shipping an AI agent? A Quick Review ($149 / ₹13,900, 1 working day) checks one repo, config or setup for leaked keys, risky agent permissions and MCP servers. Request a Quick Review
FAQ
Where is the Codex config.toml file?
User config is ~/.codex/config.toml, or config.toml inside CODEX_HOME if you set it. Projects can add .codex/config.toml, which Codex loads only when you trust the project.
How do I use profiles in Codex 0.134.0 and later?
Put each profile in its own file, ~/.codex/<name>.config.toml, and select it with --profile <name>. [profiles.<name>] tables in config.toml are no longer read.
How do I find typos in my Codex config?
Run Codex with --strict-config, which errors on fields this version doesn't recognize, and run codex doctor to check the config loads.
Codex won't start after my PC crashed. What happened?
GitHub issue #54723 and later reports describe config.toml being corrupted by a crash or power loss. Rename the damaged file and restore your settings.
Related errors
- Codex CLI: stdin is not a terminal
- MCP error -32000: Connection closed
- Gemini CLI error 429 Resource exhausted
Sources
Read 29 Nov 2026. These tools change often: if a step no longer matches, the linked page wins.
- Codex docs: Config basics: learn.chatgpt.com/docs/config-file/config-basic
- Codex docs: Advanced config: learn.chatgpt.com/docs/config-file/config-advanced
- openai/codex source: codex-rs/core/src/config/mod.rs: github.com/openai/codex/blob/main/codex-rs/core/src/config/mod.rs
- openai/codex source: codex-rs/cli/src/main.rs: github.com/openai/codex/blob/main/codex-rs/cli/src/main.rs
- openai/codex issue #24858 (legacy profile config stops startup): github.com/openai/codex/issues/24858
- openai/codex issue #52848 (key with no value, expected '='): github.com/openai/codex/issues/52848
- openai/codex issue #54723 (config.toml corrupted after a crash): github.com/openai/codex/issues/54723
- TOML v1.0.0 specification: toml.io/en/v1.0.0
- MCP config checker: scan your mcp.json for hard-coded tokens, unpinned servers and risky access
- Exposed API key checker: find API keys committed to a repo or shipped to the browser
- reviewready CLI: one command that checks an AI app repo before it ships