Skip to content

Which model to choose for writing code ​

Xiao Zhou wanted to change the color of a button on his website, opened Codex's model list, saw several names at a glance, and thought "picking the strongest one can't be wrong," so he chose the most expensive one. The job got done, but his quota bar dropped much faster than usual. The next day, when he ran into a genuinely hard-to-diagnose bug, he no longer dared to use that model.

Try it first: below are several common kinds of tasks—see which model the official guidance recommends for each.

Look it upWhich model your task at hand should use

Click one to see.

The rule for choosing a model is simple: use the tool's default model for everyday tasks, and only switch to the stronger, more expensive one temporarily for truly hard tasks. A stronger model doesn't necessarily do small tasks better, but it definitely burns quota faster.

What you'll be able to do after learning ​

  • Name which model Codex and Claude Code currently use by default
  • Choose between Sol and Astra, or Opus and Fable, based on task difficulty
  • Switch models with /model and know how switching affects your quota

What your tool uses by default right now ​

The source of "default" differs across tools, so first figure out which one you're using when you haven't changed any settings:

ToolDefault modelBasis
CodexGPT-6.2 Sol (gpt-6.2-sol)Since 0.171.0 (2026-11-20), Sol is the default choice in the model catalog
Claude CodeOpus 5.5Official model configuration page: the default for Pro, Max, Ultra, Team, Enterprise, and the Anthropic API is Opus 5.5
OpenCodeWhichever provider you connect to and whichever you pick with /models is what you getStarting with v2.3.1, after signing in with ChatGPT you can choose GPT 6.2 Sol and Astra (including fast variants)

Two things to remember:

  • Fable is never the default. The official wording is: Fable is not the default model on any plan or any provider—you have to select it yourself.

  • Codex's IDE extension: the official model page lists GPT-6.2 under both the Codex App and the CLI. When your configuration has to be shared with the IDE extension, the official guidance is to pick a model available in every client, for example gpt-6.1-sol.

  • I can name which model my go-to tool currently uses by default

Codex: Sol or Astra ​

GPT-6.2 Sol and GPT-6.2 Astra were launched on Codex on 2026-11-17. The official model page's guidance:

  • GPT-6.2 Sol: everyday tasks, such as editing code, writing documentation, or organizing several documents into a plan. Per token, it costs fewer credits than Astra.
  • GPT-6.2 Astra: the hardest tasks, such as debugging a bug across services, fixing it, and testing it.
  • GPT-6 Luna: well-defined, high-volume, repeatable tasks, such as extraction, classification, and format conversion.

Official figures (Plus tier, estimated local messages per 5 hours; credits are per million tokens):

ModelPlus, local messages per 5 hoursInput / cached input / output (credits)Default context in Codex
GPT-6.2 Sol17–180 messages50 / 2.5 / 250500,000 tokens
GPT-6.2 Astra6–50 messages200 / 10 / 1,000272,000 tokens
GPT-6.1 Sol15–160 messages50 / 2.5 / 250500,000 tokens
GPT-6 Luna350–3,000 messages2.5 / 0.25 / 12.5@@I18N_KEEP_000010@@

The official note stresses that these message counts are estimates, not fixed caps, and actual usage also depends on task size, context, and tool calls. Both GPT-6.2 models support a context of up to 1 million tokens; to use a longer context in Codex, set model_context_window in config.toml. When billed in US dollars, Sol costs $2 per million tokens of input, $0.10 for cached input, and $10 for output; Astra is $8, $0.40, and $40.

How to switch: type /model in a session to open the list; you can also specify it at launch:

bash
codex -m gpt-6.2-astra

What you should see: Codex starts the session with Astra. After finishing the hard problem, the next session without -m goes back to the default Sol. To hard-code the default, write model = "gpt-6.2-sol" in config.toml.

  • I can state that on the Plus tier, Astra gets only about a fraction of the messages per 5 hours that Sol does

Claude Code: Opus, Sonnet, Haiku, or Fable ​

Anthropic's model overview page says: if you're not sure which to use, start most work with Opus 5.5; Fable 5.2 is for highly demanding reasoning and long-running autonomous tasks, or when Opus 5.5 with raised effort still isn't enough. API prices for the four current models (per million tokens):

ModelOfficial positioningInputOutput
Fable 5.2Demanding reasoning, long-running autonomous tasks$8$40
Opus 5.5Long-running coding and knowledge work$4$20
Sonnet 5.5Best balance of speed and capability$2$10
Haiku 5.5High-volume, speed-sensitive tasks such as classification, extraction, and routingfrom $0.10from $0.50

All four models have a context of 1M tokens. The Claude Code best-practices page adds a note: the default Opus 5.5 handles most coding well, Sonnet is more cost-effective for routine work, and Haiku is well suited for simple jobs done by subagents.

Subscription users should also check limits (official pricing page): on Pro, using Fable consumes usage credits and does not count against the plan quota; Max and Ultra include Fable, but it takes up at most half of the weekly quota; Free cannot use Fable.

How to switch: type in the session:

text
/model fable

You can also use claude --model fable at startup. The aliases opus, sonnet, haiku work the same way. There is also opusplan: use Opus in plan mode to think through an approach, and automatically switch to Sonnet when executing to write code.

You should see: the model switches to Fable 5.2. If your plan requires usage credits to use Fable, the Fable row in the /model list will show “Requires usage credits”, and the session may also pop up a confirmation asking whether to continue using credits or switch back to the default model. Fable 5.2 requires Claude Code v2.1.321 or a newer version; on older versions, run claude update first.

Note: the model selected with /model is saved as your default, and all subsequent new sessions start with it. Once the hard task is done, remember to switch back with /model default.

  • I know that using Fable on the Pro plan consumes usage credits

Before adjusting further: effort ​

Besides switching models, there is an even cheaper knob: reasoning effort. In Claude Code, the default effort for Fable 5.2, Opus 5.5, Sonnet 5.5, and Haiku 5.5 is medium, which suits everyday development with a well-defined scope; the official guidance recommends high for careful-verification work such as fixing bugs in an existing codebase. Codex officials also suggest starting GPT-6.2 with the effort chosen by the client and only raising it when the task requires more planning.

So when you hit a hard problem, the order can be: first raise the effort, and if that still does not work, switch to a stronger model.

Quiz timeXiao Zhou just wants to rename a variable in Claude Code — which setting is most appropriate?

  • I know that when hitting a hard problem, I can adjust effort first before considering switching models

Checkpoint ​

  • I can state that the default model of Codex 0.171.0 is gpt-6.2-sol, and the default of Claude Code is Opus 5.5
  • I can give an example of when to switch to Astra or Fable: investigating a root cause across services
  • I can switch using /model, and I know that switching in Claude Code becomes the default for new sessions
  • I know that the message count of Codex is an official estimate, not a hard cap

Common misconceptions ​

“The most expensive model is better at everything.” Officials never said that. OpenAI positions Sol as the choice for everyday coding, and Anthropic has most work start from Opus 5.5. Using Astra to change a button color, the estimated number of messages you can send on the Plus tier per 5 hours is only 6–50, versus 17–180 for Sol.

“After upgrading Claude Code, Fable 5.2 will be used automatically.” No. Fable is not the default model of any plan. Only Pro, Max, and Ultra users who previously saved Fable 5.1 in user settings will be moved to the fable alias, that is, Fable 5.2, the first time they launch v2.1.321 or later.

“Using GPT-6.2 in OpenCode is as cheap as in Codex.” In OpenCode versions earlier than v2.3.2, GPT-6.2 re-bills the system prompt as uncached input at every step. If you use GPT-6.2, upgrade OpenCode to v2.3.2 or newer first.

Next section ​

With the model chosen, the next step is learning how to explain the work clearly: Efficient workflows.

gaodong.aiAboutPrivacyTermsContact

Created and maintained by Haorui Li, co-author of the KiT candlestick foundation model.

Independent tutorials, not affiliated with any product mentioned. Product names and trademarks belong to their owners. Check official pages for prices and policies.