Claude Sonnet 5 scores 82.1% on SWE-bench Verified and 46%+ on SWE-bench Pro, while GPT-5.4 scores 57.7% on SWE-bench Pro with comparable Verified scores around 85%. For most coding workflows, Sonnet 5 delivers a stronger autonomous code-editing experience, but GPT-5.4’s reasoning levels give it an edge in cost-flexibility for high-stakes reasoning tasks.
What Is the SWE-bench Benchmark and Why Does It Matter for Coding?
SWE-bench is the most respected real-world coding benchmark in 2026, built from actual GitHub issues submitted to production Python repositories including Django, Flask, and Scikit-learn. Unlike HumanEval — which tests isolated function writing and is now saturated at 95%+ for frontier models — SWE-bench requires a model to read a bug report, navigate a real codebase, write a patch, and pass the repository’s own test suite. This means the benchmark tests the full software engineering loop, not just code generation from a clean prompt. SWE-bench Verified contains 500 human-validated tasks, while SWE-bench Pro uses harder tasks from private and less-contaminated repositories. As of May 2026, Claude Sonnet 5 holds an 82.1% SWE-bench Verified score (the first model to break the 80% barrier) and GPT-5.4 leads SWE-bench Pro at 57.7%, reflecting fundamentally different strengths: Sonnet 5 excels at agentic, autonomous patch generation, while GPT-5.4 integrates broader reasoning and computer-use capabilities in a single model.
SWE-bench Verified vs. Pro: Which Score Should You Trust?
SWE-bench Verified (500 tasks) is the most widely cited leaderboard, but contamination is a documented problem — models trained on public GitHub data have likely seen many of these tasks. SWE-bench Pro uses harder, newer, or partially private tasks to reduce this effect. A model scoring 82% on Verified but only 46% on Pro signals benchmark contamination; a model scoring 57.7% on Pro with a consistent Verified score signals genuine generalization. For developers making purchase decisions, Pro scores are more predictive of real-world performance.
Claude Sonnet 5 vs GPT-5.4: Head-to-Head Benchmark Numbers
Claude Sonnet 5 and GPT-5.4 were released two months apart in early 2026 — Sonnet 5 on February 3 and GPT-5.4 on March 5 — and they target slightly different parts of the developer workflow. Sonnet 5 is optimized for agentic code editing, autonomous bug fixing, and extended multi-step development sessions, while GPT-5.4 is a general-purpose reasoning model that incorporates GPT-5.3 Codex’s coding capabilities alongside computer-use and knowledge-work benchmarks. The headline SWE-bench numbers make Sonnet 5 look dominant, but GPT-5.4’s architecture gives it advantages in specific categories — particularly knowledge-heavy reasoning (83% GDPval) and desktop automation (75% OSWorld). Below is a complete benchmark comparison across the metrics that matter most to developers.
| Benchmark | Claude Sonnet 5 | GPT-5.4 | Notes |
|---|---|---|---|
| SWE-bench Verified | 82.1% | ~85% | Sonnet 5 first to break 80%; GPT-5.4 benefits from later training |
| SWE-bench Pro | ~46% | 57.7% | Pro is harder, less contaminated |
| HumanEval | 95%+ | 95%+ | Saturated — no longer differentiates |
| OSWorld (computer use) | N/A | 75% | GPT-5.4 exceeds human baseline (72.4%) |
| GDPval (knowledge work) | N/A | 83% | 44 occupations, industry-professional level |
| Context Window | 1M tokens | 1.05M tokens | Near parity |
| Blind Human Eval (coding) | 47% preferred | 29% preferred | LM Council benchmarks, Q1 2026 |
The blind human evaluation result is the most practically useful number here: in head-to-head comparisons where evaluators didn’t know which model generated the code, Claude Sonnet 5 output was preferred 47% of the time versus 29% for GPT-5.4 and 24% for Gemini. For actual developers reviewing code diffs, Sonnet 5’s output reads as more correct and production-ready.
Pricing Comparison: Which Model Costs Less to Run?
Pricing at the API level is close but not identical, and the right choice depends heavily on how you use the models.
Claude Sonnet 5 is priced at $3 per million input tokens and $15 per million output tokens — unchanged from Claude Sonnet 4.5. With prompt caching enabled, cached reads drop to $0.30/MTok (90% reduction on repeated context), and the Batch API halves both input and output costs. For a typical autonomous coding workflow where the system prompt and repository context are cached, effective input costs drop to roughly $0.30-$0.60/MTok.
GPT-5.4 standard is priced at $2.50 per million input tokens and $15 per million output tokens — slightly cheaper on input but identical on output. However, GPT-5.4’s context pricing doubles beyond 272K tokens (2x input, 1.5x output), meaning long-context sessions with a full codebase loaded cost significantly more. GPT-5.4 Pro runs at $30/$180 per million tokens — a 12x premium appropriate only for the highest-stakes enterprise tasks.
| Pricing Factor | Claude Sonnet 5 | GPT-5.4 Standard | GPT-5.4 Pro |
|---|---|---|---|
| Input (standard) | $3.00/MTok | $2.50/MTok | $30/MTok |
| Output | $15.00/MTok | $15.00/MTok | $180/MTok |
| Cached input | $0.30/MTok | ~$0.63/MTok | N/A |
| Long-context surcharge | None | 2x beyond 272K | 2x beyond 272K |
| Batch discount | 50% off | 50% off | N/A |
For teams running high-volume coding pipelines with large repository contexts, Claude Sonnet 5’s flat pricing plus prompt caching makes it significantly cheaper in practice, despite the slightly higher nominal input rate.
Agentic Coding Capabilities: Dev Team Mode vs. Reasoning Effort Levels
This is where the two models diverge most sharply in their architecture and philosophy.
Claude Sonnet 5 introduces Anthropic Agent Teams (also called Dev Team Mode), which enables the model to spawn specialized sub-agents — Backend, QA, Technical Writer — that work in parallel on different parts of a task. In a typical workflow, a Sonnet 5 orchestrator agent reads the issue, spawns a backend agent to write the patch, a QA agent to write tests, and a documentation agent to update comments, then merges the results. This reduces wall-clock time for complex multi-file changes. Verified by Vals AI, the model demonstrated 0% code-editing error rate on internal benchmarks (down from 9% for Sonnet 4) and sustained focus across 30+ hour autonomous coding sessions.
GPT-5.4 takes a different approach with its reasoning_effort parameter, which accepts five levels: none, low, medium, high, and xhigh. This controls how many reasoning tokens the model spends before responding — an xhigh request costs 3-5x more than low but produces significantly better results on ambiguous or architecturally complex problems. GPT-5.4 also integrates native Computer Use, allowing it to control a desktop, run code in a hosted shell, and interact with GUIs directly — capabilities Sonnet 5 accesses only through external tooling.
For most coding use cases (bug fixes, PR generation, code review), Sonnet 5’s parallel agent architecture is the more practical choice. For tasks that require dynamic reasoning investment — say, debugging a race condition in a distributed system — GPT-5.4’s tunable reasoning levels give developers more precise control over the cost-quality tradeoff.
Real-World Developer Performance: What Benchmark Scores Don’t Tell You
SWE-bench scores explain what a model can do on Python GitHub issues from 2024 and earlier. They don’t tell you how the model behaves on:
- Your proprietary codebase: On SWE-bench Pro’s private subset, models score 30-40% lower than on the public Verified set. Claude Opus 4.1 dropped from 22.7% to 17.8% and GPT-5 dropped from 23.1% to 14.9% when tested on private repositories. Assume similar drops for both Sonnet 5 and GPT-5.4.
- Non-Python languages: SWE-bench is Python-only. For TypeScript, Rust, or Go codebases, both models’ real performance is unknown from public benchmarks.
- Instruction following under ambiguity: Sonnet 5’s 0% internal error rate on code edits suggests it’s significantly less likely to make destructive changes or hallucinate function signatures. GPT-5.4 at
mediumreasoning effort is comparable; atlow, it makes more mistakes. - Latency: Sonnet 5 is faster for standard code completion tasks. GPT-5.4 at
xhighreasoning can be slower than a full Sonnet 5 agentic session.
For teams that want to validate before committing, the most reliable approach is to build a private mini-benchmark from 20-30 real bugs or feature requests from your own backlog, run both models against it, and measure pass rate. This takes a few hours but produces data specific to your language, stack, and code complexity.
Which Model Should You Use? Decision Framework
Choose Claude Sonnet 5 if:
- Your primary use case is autonomous bug fixing, PR generation, or full-cycle code editing
- You want native agentic orchestration without managing separate tools
- You’re running high-volume pipelines where prompt caching provides a material cost advantage
- You use Claude Code, Cursor, or any IDE integration built on the Anthropic API
- Human preference for code quality is your top metric
Choose GPT-5.4 if:
- You need computer-use automation (controlling a desktop, Selenium replacement, GUI testing)
- You’re building complex reasoning pipelines where
reasoning_efforttuning matters - You’re already on OpenAI’s platform and want a drop-in replacement for gpt-5.2
- Your use case combines knowledge work (GDPval-style tasks) with code generation
- You need gpt-5.4-pro’s ceiling for the most complex enterprise tasks
The honest middle ground: Most engineering teams in 2026 use both. Sonnet 5 runs as the default coding agent; GPT-5.4 handles specific tasks where computer-use or high-reasoning-effort mode is necessary. The pricing difference is negligible at moderate scale — the decision should be capability-first.
SWE-bench 2026 Leaderboard Context
The May 2026 SWE-bench leaderboard reveals a tiered market with a clear gap between models designed for autonomous code editing and general-purpose reasoning models that include coding as one capability among many. Claude Mythos Preview leads at 93.9% Verified and 77.8% Pro — but it is not yet available through the standard Anthropic API, making it a benchmark reference point rather than a practical option. The immediately accessible tier includes Claude Opus 4.7 Adaptive (87.6% Verified), GPT-5.4 (~85% Verified, 57.7% Pro), Claude Sonnet 5 (82.1% Verified), and GPT-5.3 Codex (85% Verified). Gemini 3.1 Pro sits around 70% Verified and trails significantly on Pro, suggesting Google’s model generalizes less well to unfamiliar codebases. The key insight from the 2026 leaderboard is that the Verified-to-Pro gap is a better signal of real-world reliability than the Verified score alone — and on that metric, GPT-5.4 currently leads the accessible market.
To put Sonnet 5 and GPT-5.4 in broader context, here’s where they sit in the May 2026 leaderboard:
| Model | SWE-bench Verified | SWE-bench Pro |
|---|---|---|
| Claude Mythos Preview | 93.9% | 77.8% |
| Claude Opus 4.7 Adaptive | 87.6% | ~50% |
| GPT-5.4 | ~85% | 57.7% |
| Claude Sonnet 5 | 82.1% | ~46% |
| GPT-5.3 Codex | 85.0% | ~45% |
| Gemini 3.1 Pro | ~70% | ~38% |
Claude Mythos Preview leads both leaderboards but is not yet available for general API access. For what’s actually available to developers today, the Sonnet 5 / GPT-5.4 pairing represents the effective frontier.
FAQ
Is Claude Sonnet 5 better than GPT-5.4 for coding? On most coding benchmarks and in blind human evaluations, Claude Sonnet 5 performs better for autonomous code editing and patch generation. GPT-5.4 has an edge in SWE-bench Pro and for tasks requiring computer-use or high-reasoning-effort mode. For pure coding workflows, Sonnet 5 is the current preference; for multi-modal or reasoning-heavy tasks, GPT-5.4 is competitive.
What does 82.1% SWE-bench mean in practice? It means Claude Sonnet 5 successfully fixed 82.1% of 500 real GitHub issues — reading the bug report, finding the right file, writing a patch, and passing the repository’s own tests — without human guidance. This is the highest score achieved by any generally available model as of February 2026.
How do I compare SWE-bench Verified vs. Pro scores? Verified scores are inflated by data contamination (models trained on public GitHub data have likely seen these tasks). Pro scores use harder, less-contaminated tasks and are more predictive of real-world performance. A model with a large gap between Verified and Pro scores (like dropping from 82% to 46%) may be partially memorizing the Verified dataset.
What is GPT-5.4’s reasoning_effort parameter?
It’s a parameter (none, low, medium, high, xhigh) that controls how many reasoning tokens GPT-5.4 uses before responding. Higher settings improve accuracy on complex problems but cost 3-5x more. For routine code completion, low or medium is cost-effective; for architectural decisions or complex debugging, high or xhigh is recommended.
Can I use both Claude Sonnet 5 and GPT-5.4 in the same pipeline? Yes, and many teams do. A common pattern is to use Sonnet 5 as the primary autonomous coding agent (leveraging Agent Teams for parallel execution) and route specific subtasks — computer-use automation, reasoning-heavy debugging — to GPT-5.4. Both models support function calling, tool use, and similar API patterns, making integration straightforward.
