ThisCalculator

Everyday

Claude Opus 4 and Sonnet 4: A New Coding Benchmark?

Updated · Standard formula, shown below

Claude Opus 4 and Sonnet 4: A New Coding Benchmark?

Yes—in May 2025, Anthropic presented Claude Opus 4 and Claude Sonnet 4 as a substantial step forward in coding, with Opus 4 setting a new high on the company’s reported benchmark results. That is meaningful evidence of stronger software-engineering ability, but it does not establish that either model is universally the best coder: scores depend on the test, setup, and model version.

What Anthropic announced

Anthropic announced Claude Opus 4 and Sonnet 4 on May 22, 2025, describing them as hybrid models that support both near-instant responses and extended thinking. Opus is the higher-capability model in the pair, aimed at demanding, longer-running work; Sonnet is positioned as a faster, less expensive option for many everyday tasks.

The coding claims attracted particular attention because the release emphasized agents that can work through multi-step tasks, use tools, and sustain effort over longer sessions. This is a different goal from simply producing a convincing code snippet in a chat window. A useful coding model must also understand a repository, find relevant files, make changes, run tests, and respond sensibly when those tests fail.

Anthropic’s launch materials reported that Opus 4 achieved 72.5% on SWE-bench Verified, a benchmark of real GitHub issue-resolution tasks, and 43.2% on Terminal-Bench, which assesses command-line work. These are vendor-reported figures for the launch evaluation, not a timeless ranking: benchmark implementations, model versions, and evaluation conditions can change.

What the benchmark results mean

SWE-bench Verified asks a system to resolve software issues drawn from real repositories. The benchmark supplies a task and a codebase; the model or agent must make a patch that passes the relevant tests. Verified refers to a curated subset intended to reduce problems with ambiguous or flawed tasks. A score is the fraction of benchmark tasks passed under a particular evaluation setup.

That result is more informative about practical coding than a quiz asking for a function from scratch, but it is not equivalent to “the model can fix 72.5% of bugs in your company.” Real projects differ in language, documentation, test coverage, dependencies, permissions, and the quality of issue reports. An agent may also be allowed different tools or numbers of attempts in different evaluations.

Terminal-Bench adds another kind of work: operating in a terminal environment, where an agent may need to inspect files, run commands, and complete a task through a sequence of actions. Strong performance there suggests useful tool-use ability, but it does not measure every developer skill, such as architecture judgment, code review, or communication with a product team.

Why Opus 4 and Sonnet 4 matter for coding

The notable change is not only code generation. Long-running agentic work requires a model to keep track of its goal, recover from mistakes, and use feedback from tools. Anthropic said Opus 4 could work for extended periods on complex tasks, while both models support a choice between quick responses and a more deliberate extended-thinking mode.

In practical terms, a developer might ask an agent to trace a bug across several files, update a test, run the test suite, and explain the patch. The model’s usefulness depends on whether it can make changes that fit the project rather than merely write plausible-looking code. A strong benchmark result makes that workflow more promising; it does not remove the need to inspect the diff, run checks, and confirm behavior.

Anthropic also introduced features for more capable tool use, including parallel tool calls and the ability to work with external tools through its Model Context Protocol (MCP). Those capabilities can help agents gather context or delegate steps, but they are part of the surrounding system as much as the underlying model. A benchmark score should therefore be read with its agent harness and permitted tools in mind.

How the models compare

Opus 4 and Sonnet 4 share the same generation and broad hybrid approach, but they serve different trade-offs. Opus is the choice to consider when a task is complex, lengthy, or costly to get wrong. Sonnet is intended to provide strong performance with better speed and cost characteristics for routine work. Exact prices and availability depend on where and how the models are accessed, so check Anthropic’s current product or API information rather than relying on launch-era figures.

  • Choose Opus 4 for difficult codebase investigations, multi-stage changes, or tasks that benefit from sustained reasoning—while keeping a human review process.
  • Choose Sonnet 4 for common coding assistance, explanations, smaller changes, and workflows where response speed and usage cost matter.
  • Compare them on your own tasks if the decision matters: use representative issues, the same tools and instructions, and a consistent measure of passing tests and review effort.

Neither model should be assumed to outperform every competing system on every programming language or workflow. A benchmark’s leaderboard is a snapshot under defined conditions, not a universal measure of software-engineering quality.

Limitations and responsible use

Coding agents can make incorrect edits, misunderstand requirements, overlook edge cases, or introduce security and reliability bugs. They may also misread test output or claim a task is complete when important checks remain. Passing a benchmark test is useful evidence, not a guarantee that a change is correct in production.

For safer use, give the agent only the access it needs and treat its changes like a human-authored patch:

  • Review the full diff, including generated files and dependency changes.
  • Run relevant unit, integration, and security checks in the project’s normal environment.
  • Keep secrets and sensitive data out of prompts and tool contexts unless the system is explicitly approved to handle them.
  • Require a person to approve consequential changes, especially those affecting authentication, payments, data handling, or production infrastructure.

Extended reasoning can improve performance on some hard tasks, but it may take longer or use more resources. More thinking is not automatically better: a clear, bounded request and a reliable test suite can matter as much as the model choice.

Frequently Asked Questions

Did Claude Opus 4 set a new coding benchmark?
Anthropic reported that Opus 4 reached 72.5% on SWE-bench Verified at launch and described it as a leading result. Whether “new benchmark” is accurate depends on the date, the evaluation setup, and which comparison set is being used.

Is Claude Opus 4 better at coding than Sonnet 4?
Opus 4 is Anthropic’s higher-capability option for demanding work, while Sonnet 4 is designed to balance capability with speed and cost. The better choice for a particular project depends on its tasks and constraints.

What is SWE-bench Verified?
It is a curated benchmark of software issues from real GitHub repositories. Systems attempt to produce patches that satisfy the tasks’ tests; the score reflects results on that benchmark under a specified evaluation process.

Can Claude 4 code without human review?
No. It can assist with writing and changing code, but benchmark performance does not guarantee correctness, security, or compatibility with a specific project. Review changes and run appropriate tests before relying on them.

Does a higher benchmark score mean the best model for every developer?
No. Scores cover selected tasks and conditions. Language support, tool integrations, latency, cost, privacy requirements, and performance on a team’s actual codebase can all affect the practical choice.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.