Which Claude Model Is Best for Coding

Orr Yakobi
For most coding work, start with Claude Opus 5.5. Escalate to Claude Fable 5.1 for demanding reasoning and long-horizon agentic work, drop to Claude Sonnet 5 when speed and cost matter more than depth, and use Claude Haiku 4.5 for high-volume, low-complexity tasks. That is Anthropic's own guidance, and it is the shortest honest answer to the question.
This article compares the four current models on price, latency, context window and intended use, then covers how to route work between them. All figures below come from Anthropic's models overview and were checked on 24 September 2026. Model lineups move quickly, so check that page before acting on any comparison, including this one.
Key Takeaways
- Anthropic recommends starting with Claude Opus 5.5 for most workloads, and moving to Claude Fable 5.1 only when your own evaluations on Opus 5.5 at higher effort still fall short.
- Claude Fable 5.1 is the top tier for demanding reasoning and long-horizon agentic work. It is also the slowest and the most expensive, at $10 per million input tokens and $50 per million output tokens.
- Claude Sonnet 5 is described as the best combination of speed and intelligence, at $2 / $10 per million tokens — a quarter of Fable 5.1's cost with the same 1M-token context window.
- Claude Haiku 4.5 is the fastest and cheapest at $1 / $5, but carries a 200K context window rather than 1M, which is the real constraint on using it for large codebases.
- Claude Opus 5 is a legacy model. If a comparison names it as the current best choice for coding, that comparison is out of date — the current Opus tier is Opus 5.5.
The Current Lineup at a Glance
Four models are current as of September 2026. Everything in this table is from Anthropic's published model documentation.
| Claude Fable 5.1 | Claude Opus 5.5 | Claude Sonnet 5 | Claude Haiku 4.5 | |
|---|---|---|---|---|
| Anthropic's description | For demanding reasoning and long-horizon agentic work | For long-running agentic coding and knowledge work | The best combination of speed and intelligence | The fastest model with near-frontier intelligence |
| Comparative latency | Slower | Moderate | Fast | Fastest |
| Price per million tokens | $10 in / $50 out | $4 in / $20 out | $2 in / $10 out | $1 in / $5 out |
| Context window | 1M tokens | 1M tokens | 1M tokens | 200K tokens |
| Max output | 128K tokens | 128K tokens | 128K tokens | 64K tokens |
| Default effort | High | Medium | High | Not supported |
| Claude API model ID | claude-fable-5-1 | claude-opus-5-5 | claude-sonnet-5 | claude-haiku-4-5-20251001 |
Two things in that table decide most routing questions. The price spread is ten to one between Fable 5.1 and Haiku 4.5, so model choice is a budget decision as much as a capability one. And Haiku 4.5 is the only model without a 1M-token context window, which matters more for coding than the headline capability difference — a 200K window constrains how much of a codebase the model can hold at once.
Start Here: Claude Opus 5.5
Anthropic's own advice is unambiguous: if you are unsure which model to use, start with Claude Opus 5.5. It is described as built for long-running agentic coding and knowledge work, which is exactly the shape of most serious engineering tasks — multi-step refactors, debugging across files, work that runs for a while without a human correcting it every few minutes.
It sits in the middle of the lineup on latency and carries a 1M-token context window, so it can hold a substantial amount of a codebase at once. Its default effort level is medium, which means there is headroom: if a task fails at the default, raising effort is the first thing to try, before switching models.
That sequence matters. Reaching for a bigger model is the expensive reflex. Raising effort on Opus 5.5 costs nothing extra in integration work and often closes the gap.
When to Escalate: Claude Fable 5.1
Claude Fable 5.1 is the tier above, for demanding reasoning and long-horizon agentic work. Anthropic frames the decision to use it as conditional rather than automatic: move to Fable 5.1 when your evaluations on Opus 5.5 at higher effort still fall short.
That framing is a useful discipline. It puts the burden on measurement — you should be able to point at an eval that Opus 5.5 failed before paying 2.5× the input price and accepting slower responses. Its default effort is already high, and it shares the 1M-token context window, so what you are buying is reasoning depth on genuinely hard problems, not more room.
The work that justifies it tends to be long-horizon: an agent running for hours across a large codebase, architecture decisions with many interacting constraints, or debugging where the cause is several steps removed from the symptom.
The Balanced Default: Claude Sonnet 5
Claude Sonnet 5 is described as the best combination of speed and intelligence, and for a lot of day-to-day coding that is the right trade. It is fast, it costs $2 / $10 per million tokens, and it keeps the full 1M-token context window — so the compromise against the Opus tier is reasoning depth, not working memory.
Its default effort is high, which is worth knowing when comparing it against Opus 5.5's medium default. A naive comparison at default settings is not comparing the two models at equivalent settings.
Sonnet 5 suits feature development, refactoring, test writing and the long tail of ordinary engineering work where the task is well-scoped and the answer does not require unusual depth.
The Volume Tier: Claude Haiku 4.5
Claude Haiku 4.5 is the fastest model in the lineup and the cheapest at $1 / $5 per million tokens. Anthropic describes it as having near-frontier intelligence, and it suits boilerplate generation, formatting, simple transformations and any task you run thousands of times where latency and cost dominate.
Two constraints decide whether it fits. Its context window is 200K tokens rather than 1M, so it cannot hold a large codebase the way the other three can. And it does not support the effort parameter at all, so the escalation path that works on Opus 5.5 is not available — if Haiku 4.5 fails a task, the next step is a different model, not a different setting.
How to Route Work Between Them
Three questions decide the model, in this order.
- Does the task need the whole codebase in context? If yes, Haiku 4.5 is out on the 200K window alone, regardless of how capable it is.
- Does it run unattended? Long-running agentic work with nobody watching is what the Opus tier is described for. Work with a human in the loop every few minutes can sit lower, because a person catches the drift.
- How often does it run? The ten-to-one price spread means a task you run once a week and a task you run ten thousand times a day belong on different tiers even when they look identical.
What should not decide it is habit. The failure we see most often is a team standardising on one model because it is the one they set up first, then paying frontier prices for boilerplate or accepting a 200K window on work that needs a million.
What We Run, and Why
One concrete case rather than a general claim: the daily content pipeline that produced the first draft of this article runs unattended, on a schedule, with no one present to redirect it mid-task. That job runs on Claude Sonnet 5, not Opus or Fable.
The reasoning is the routing logic above. The task is well-scoped and repeats daily, so predictability matters more than reasoning depth, and the frequency makes cost real. It needs more judgment than Haiku 4.5's tier is built for, and it does not need what the Opus tier is for. Our hosted agent work and our scheduled headless runs follow the same reasoning.
Worth being precise about what that is and is not evidence of: it is a real routing decision with a stated rationale, not a benchmark. We have not published measured turn counts or cost-per-task comparisons across the four tiers, and a claim like that would need numbers behind it.
If You Are Still on Claude Opus 5
Claude Opus 5 is a legacy model. So are Claude Fable 5, Opus 4.8, Opus 4.7, Opus 4.6, Opus 4.5, Sonnet 4.6 and Sonnet 4.5. They remain available, and Anthropic publishes retirement commitments for each, but they are not the current lineup.
This is the single most common way a model comparison goes stale, and it is worth checking before you trust any article on this topic, including this one: confirm that the models being compared are the current ones. A guide recommending Opus 5, Opus 4.5 or Sonnet 4.5 as today's best coding model is describing a lineup that has moved on.
If you are running an older tier, Anthropic publishes a migration guide for moving to Opus 5.5. The practical advice is the same as for any model change: keep your evaluations, run them against the new model, and compare on your own tasks rather than on a benchmark table.
Conclusion
The short answer holds: start on Claude Opus 5.5, escalate to Fable 5.1 only when an evaluation tells you to, use Sonnet 5 for balanced day-to-day work, and reserve Haiku 4.5 for high-volume tasks that fit inside 200K tokens.
The more durable advice is to build the evaluation before you need it. Every recommendation in this article is a starting point that will expire when the lineup changes. A small set of tasks from your own codebase, scored consistently, will outlast any comparison table — including this one. Teams that run agents across parallel branches will also want the surrounding discipline, which we covered in our engineering playbook.
FAQs
1. Which Claude model is best for coding?
Claude Opus 5.5 is the recommended starting point for most coding workloads, and Claude Fable 5.1 is the higher tier for demanding reasoning and long-horizon agentic work. The right answer depends on whether the task runs unattended, how much of the codebase it needs in context, and how often it runs.
2. How do I choose between Claude Opus 5.5 and Claude Sonnet 5?
Opus 5.5 is built for long-running agentic coding; Sonnet 5 is the best balance of speed and intelligence at a fifth of the input price. Both carry a 1M-token context window, so the trade is reasoning depth rather than working memory. Note that their default effort levels differ — medium for Opus 5.5, high for Sonnet 5 — so a comparison at default settings is not a like-for-like test.
3. Is Claude Opus 5 still the best model for coding?
No. Claude Opus 5 is a legacy model. The current model in that tier is Claude Opus 5.5. Older models remain available and Anthropic publishes retirement dates for each, but a comparison naming Opus 5 as today's best coding model is out of date.
4. When is Claude Haiku 4.5 the right choice?
When the task is high volume, low complexity and fits inside a 200K-token context window — boilerplate, formatting, simple transformations. It is the fastest and cheapest of the four. It does not support the effort parameter, so if it fails a task the next step is a different model rather than a different setting.
5. What should a team test before committing to a model?
Build a small set of evaluation tasks from your own codebase and score them consistently across models. Test at matched effort levels, not default settings. Measure iteration speed and error rate on real work rather than relying on published benchmarks, which rarely resemble your codebase.
6. How much does model choice affect cost?
The spread between the cheapest and most expensive current model is ten to one on both input and output tokens — $1 / $5 per million for Haiku 4.5 against $10 / $50 for Fable 5.1. For a task that runs a handful of times, that difference is noise. For one that runs continuously, it is the dominant line in the bill.
Other Articles
We build the engineering. You build the business.
If you are trying to figure out whether SWARECO is the right fit for what you are building, the best way to find out is to talk. Tell us what you have. We will be direct about what we can do and how we would approach it.









