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.

  • Codex Mastery
  • $codex-model-selection
  • 151 lines
  • 2 files
  • ~1,650 tokens
  • MIT
  • Updated

Install

curl -fsSL codexskills.dev/install.sh \  | sh -s -- codex-model-selection

Installs to ~/.agents/skills/codex-model-selection/ 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-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

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.

~/.agents/skills/codex-model-selection/SKILL.md

--- name: codex-model-selection description: Chooses the Codex model and reasoning effort per task (low through xhigh, max, ultra), reads what the installed CLI actually supports from codex… license: MIT ---

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)

ModelSlugPositioningStart with
GPT-6 Astragpt-6-astraMost capable; hardest end-to-end work, broad context, judgmentlow (shown as Light), raise if needed
GPT-6.1 Solgpt-6.1-solNear-Astra quality at lower cost; repeated and long-running workclient default, often medium
GPT-6.1 Terragpt-6.1-terraFast and efficient; writing, visual understanding, scoped fixes; needs CLI 0.159.0+client default
GPT-6 Lunagpt-6-lunaMost efficient; focused, high-volume, well-specified taskshigh

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

TaskModelEffort
Rename, small refactor, lint fixes, extraction, formattingLunalow-medium
High-volume, well-specified batch jobs (classification, summaries)Lunamedium-high
Typical feature or bug fix with testsSolmedium
Scoped fix with clear verification, docs writing, screenshot workTerradefault
Unfamiliar codebase, cross-cutting refactor, design trade-offsAstra or Solmedium-high
Hard debugging with conflicting evidence, concurrency, security reviewAstrahigh-xhigh
Single extremely hard problem, time is not a concernsupporting modelmax
Large task that splits into independent partssupporting modelultra (uses subagents)

Rules of thumb:

  • Most tasks do not need max or ultra. max gives one agent more thinking time; ultra delegates parts of the task to subagents in parallel and multiplies usage. Luna supports up to max, not ultra.
  • 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_effort values the model does not advertise are rejected or ignored; check supported_reasoning_levels in the catalog.
  • In the desktop app and IDE, the lowest effort is labelled Light; in config it is low.
  • review_model and plan_mode_reasoning_effort silently change cost of /review and /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.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 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.

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