Claude Code

Choosing model, effort and auto-compact in Claude Code per task

TL;DR

Model sets capability, effort sets thinking depth, and auto-compact sets how big context grows. Choose all three at session start by task type, use ultrathink for hard turns, and avoid switching mid-session to keep the prompt cache.

Same Claude Code, yet some people find it "fast and cheap" and others "slow and expensive". Much of the difference comes from three settings few people tune: model, effort and the auto-compact window. Choosing them per task is the most effective way to optimise quality and tokens, even before optimising prompts.

Model aliases

AliasMeaning
defaultClears overrides and uses your account's default (currently Opus 5.5 on most plans)
opus, sonnet, haikuThe newest version of each family on the Anthropic API
fable, bestfable is Fable 5.1 (must be selected); best uses Fable where available, otherwise Opus
opusplanOpus in plan mode, Sonnet for execution
sonnet[1m], opus[1m]Request the 1-million-token context window

Precedence when setting the model: /model in a session → claude --model → the ANTHROPIC_MODEL variable → the model field in settings. In /model, Enter saves it as your default and s applies it to the current session only.

Effort: how much Claude thinks

  • Levels: low, medium, high, xhigh, max.
  • Defaults: high on most models; medium on Opus 5.5, Sonnet 5.5 and Haiku 5.5.
  • Set with /effort (slider), /effort high, /effort auto, the --effort flag, or CLAUDE_CODE_EFFORT_LEVEL.
  • Add ultrathink to a prompt to request deeper reasoning for that turn only.

1M context and auto-compact

  • Fable, Sonnet 5 and later, Haiku 5.5, and Opus 4.7 and later use the 1M window by default. CLAUDE_CODE_DISABLE_1M_CONTEXT=1 forces 200K.
  • /autocompact 500k sets the auto-compact threshold for the current model (100K to 1M). A big window doesn't mean you should fill it: compacting earlier keeps quality up and per-turn cost down.

Suggestions by task

TaskSuggestion
Small fixes, renames, simple testsSonnet or Haiku, low/medium effort
Everyday featuresYour account default
Architecture, hard debugging, big refactorsOpus or Fable, high/xhigh effort, or opusplan
Reading a huge codebase in one goA 1M-context model, but prefer delegating reads to a subagent

Fallback models

--fallback-model sonnet,haiku (or the fallbackModel array in settings) tries up to three models in order when the primary is overloaded or unavailable; the switch lasts one turn.

Risks and caveats

  • Switching model or effort mid-session breaks the prompt cache on most models; the next turn rereads the whole conversation. Choose at the start.
  • opusplan switches models on every plan-mode toggle, meaning a fresh cache each time.
  • Higher effort isn't always better: overthinking simple tasks just costs time.

How to apply it

  • Dev: Set a sensible default in settings and raise effort or use ultrathink only for hard turns.
  • Tech Lead: Standardise model configuration for the team; use availableModels in managed settings if you need limits.
  • PM: When costs rise, check which models and effort the team uses for which work before cutting back.

Sources & references

  1. Model configuration — Claude Code Docs