Codex Model Selection skill for Codex
The lightest model and effort that still passes. Codex checks which models and effort levels the installed CLI and account actually support, maps the task to a model and effort from low to max or ultra, sets defaults in config.toml or a profile file, and runs a same-input comparison scored on tests, diff size, time and tokens before standardizing, so teams stop overpaying or under-powering.
curl -fsSL codexskills.dev/install.sh \ | sh -s -- codex-model-selection Installs to ~/.agents/skills/codex-model-selection/ for every project on this machine.
curl -fsSL codexskills.dev/cli.mjs -o codex-skills.mjsnode codex-skills.mjs install codex-model-selection 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-model-selection Installs to .agents/skills/codex-model-selection/ in the current repository. Commit it and everyone who runs Codex there gets it.
curl -fsSLO codexskills.dev/downloads/codex-model-selection.zipunzip -o codex-model-selection.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-model-selection 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-model-selection, 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
Chooses the Codex model and reasoning effort per task (low through xhigh, max, ultra), reads what the installed CLI actually supports from codex debug models, sets defaults, per-profile and per-run overrides (model, model_reasoning_effort, plan_mode_reasoning_effort, review_model, service_tier) and runs a small same-input comparison before committing. Use when the user asks which model or effort to use, whether a task needs max or ultra, why a model id fails or disappeared, or how to trade quality against speed and usage.
Use it when
- Deciding model and reasoning effort for a task, team or pipeline
- A model id stopped working after a retirement
- Unsure whether max or ultra is worth the extra usage
- Setting review_model or plan_mode_reasoning_effort defaults
Use something else when
- The goal is cutting overall spend across many levers: use codex-cost-control
- You are designing a whole set of named config files: use codex-profiles
How to check the result
/status shows the intended model and effort, and the comparison table shows the chosen setting passing every representative task at the lowest recorded token use.
The mistake it prevents
Hard-coding a model slug across scripts and CI, which breaks every job on the day that model retires.
A model choice is done well when it is the lightest setting that meets an explicit quality bar on representative tasks, it is pinned where repeatability matters (automation, CI), and it is not hard-coded in places that break when a model retires.
Ground truth first
Model ids change and retire on a schedule. Before recommending a slug, check what this installation and account can use:
codex --version
codex debug models | jq -c '.models[] | select(.visibility=="list")
| {slug, default: .default_reasoning_level, efforts: [.supported_reasoning_levels[].effort]}'
In a session, /model lists only models available to the signed-in account and
workspace, and /status confirms the active model. API-key sessions follow the API
organization’s model access instead of the ChatGPT plan.
Current lineup (official docs, October 2026)
| Model | Slug | Positioning | Start with |
|---|---|---|---|
| GPT-6 Astra | gpt-6-astra | Most capable; hardest end-to-end work, broad context, judgment | low (shown as Light), raise if needed |
| GPT-6.1 Sol | gpt-6.1-sol | Near-Astra quality at lower cost; repeated and long-running work | client default, often medium |
| GPT-6.1 Terra | gpt-6.1-terra | Fast and efficient; writing, visual understanding, scoped fixes; needs CLI 0.159.0+ | client default |
| GPT-6 Luna | gpt-6-luna | Most efficient; focused, high-volume, well-specified tasks | high |
Retired for ChatGPT sign-in: gpt-5.5 (Oct 14 2026), gpt-5.4 and gpt-5.4-mini
(Aug 31 2026), gpt-5.3-codex-spark (Sep 14 2026); gpt-5.2 and gpt-5.3-codex are
deprecated. API-key sessions are not affected by these ChatGPT-plan retirements.
Re-check the models page before relying on this table.
Decide
| Task | Model | Effort |
|---|---|---|
| Rename, small refactor, lint fixes, extraction, formatting | Luna | low-medium |
| High-volume, well-specified batch jobs (classification, summaries) | Luna | medium-high |
| Typical feature or bug fix with tests | Sol | medium |
| Scoped fix with clear verification, docs writing, screenshot work | Terra | default |
| Unfamiliar codebase, cross-cutting refactor, design trade-offs | Astra or Sol | medium-high |
| Hard debugging with conflicting evidence, concurrency, security review | Astra | high-xhigh |
| Single extremely hard problem, time is not a concern | supporting model | max |
| Large task that splits into independent parts | supporting model | ultra (uses subagents) |
Rules of thumb:
- Most tasks do not need
maxorultra.maxgives one agent more thinking time;ultradelegates parts of the task to subagents in parallel and multiplies usage. Luna supports up tomax, notultra. - Raise effort before switching to a bigger model when the failure is shallow planning; switch model when the failure is missing knowledge or judgment.
- Lower effort when output is correct but slow.
- Effort levels do not map one-to-one across model generations; re-test after an upgrade.
Configure
# ~/.codex/config.toml
model = "gpt-6.1-sol"
model_reasoning_effort = "medium" # low | medium | high | xhigh | max | ultra (model-dependent)
plan_mode_reasoning_effort = "high" # used by /plan; unset = built-in preset
review_model = "gpt-6-astra" # used by /review; defaults to the session model
Per profile (Codex 0.134.0+ uses one file per profile):
# ~/.codex/deep.config.toml -> codex --profile deep
model = "gpt-6-astra"
model_reasoning_effort = "high"
Per run:
codex -m gpt-6-luna -c model_reasoning_effort='"low"' "fix the lint errors in src/utils"
codex exec -m gpt-6.1-sol "summarize risky changes since v2.3.0"
Interactive: /model switches model; choose More reasoning… to reach max or
ultra where supported. IDE extension: model switcher under the composer, or
/model and /reasoning.
Speed tiers
/fast toggles the Fast service tier when the model’s catalog entry offers one; persist
with service_tier = "fast". Fast mode consumes included plan usage at 2.5x the
Standard rate (2x for purchased credits). Ultrafast (Astra and Sol on eligible plans)
consumes 8x included usage (6x credits). Use them when a human is waiting, not for
overnight batches.
Compare before standardizing
- [ ] 1. Pick 3-5 representative tasks with known-good outcomes
- [ ] 2. Fix the inputs, AGENTS.md and repo commit
- [ ] 3. Run candidate model/effort pairs, one variable at a time
- [ ] 4. Score: tests pass, diff size, review fixes needed, wall time, tokens
- [ ] 5. Keep the lightest setting that passes every task
For headless comparisons, capture usage from codex exec --json (the
turn.completed event carries input_tokens, cached_input_tokens, output_tokens,
reasoning_output_tokens):
# Run in a disposable clone: each iteration resets the working tree to $BASE.
for m in gpt-6-luna gpt-6.1-sol; do
git reset -q --hard "$BASE" && git clean -fdq
codex exec -m "$m" --sandbox workspace-write --json "$(cat ../task.md)" > "../run-$m.jsonl"
npm test --silent >/dev/null 2>&1 && echo "$m tests: pass" || echo "$m tests: fail"
jq -c 'select(.type=="turn.completed") | .usage' "../run-$m.jsonl"
git diff --stat "$BASE" | tail -1
done
Never run that loop in a checkout with work you care about; ask before resetting anything outside a scratch clone.
Gotchas
- A retired slug in
config.toml, a profile file, an SDK script or a CI job fails at start-up. Grep for model ids when a retirement is announced:rg -n 'gpt-5\.(2|3|4|5)' ~/.codex .codex .github scripts. model_reasoning_effortvalues the model does not advertise are rejected or ignored; checksupported_reasoning_levelsin the catalog.- In the desktop app and IDE, the lowest effort is labelled Light; in config it is
low. review_modelandplan_mode_reasoning_effortsilently change cost of/reviewand/plan; document them in team config.- Higher effort is not a substitute for a precise prompt with done-criteria.
Output template
**Recommendation:** gpt-6.1-sol, effort medium (default); escalate to gpt-6-astra high
for tasks tagged `arch` or `security`.
**Evidence:** 5 tasks; Luna low failed 2/5 (missed edge cases), Sol medium passed 5/5
at 38% of Astra's tokens; Astra high passed 5/5, 2.1x slower.
**Config change:** model/model_reasoning_effort in ~/.codex/config.toml; deep profile
added at ~/.codex/deep.config.toml. 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 Model Selection"
short_description: "The lightest model and effort that still passes"
default_prompt: "$codex-model-selection Which model and reasoning effort should I use for this refactor?" 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.