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
| Alias | Meaning |
|---|---|
default | Clears overrides and uses your account's default (currently Opus 5.5 on most plans) |
opus, sonnet, haiku | The newest version of each family on the Anthropic API |
fable, best | fable is Fable 5.1 (must be selected); best uses Fable where available, otherwise Opus |
opusplan | Opus 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:
highon most models;mediumon Opus 5.5, Sonnet 5.5 and Haiku 5.5. - Set with
/effort(slider),/effort high,/effort auto, the--effortflag, orCLAUDE_CODE_EFFORT_LEVEL. - Add
ultrathinkto 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=1forces 200K. /autocompact 500ksets 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
| Task | Suggestion |
|---|---|
| Small fixes, renames, simple tests | Sonnet or Haiku, low/medium effort |
| Everyday features | Your account default |
| Architecture, hard debugging, big refactors | Opus or Fable, high/xhigh effort, or opusplan |
| Reading a huge codebase in one go | A 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.
opusplanswitches 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
ultrathinkonly for hard turns. - Tech Lead: Standardise model configuration for the team; use
availableModelsin 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
- Model configuration — Claude Code Docs