Table of Contents
Claude Sonnet 5 vs GPT-5.5 vs Gemini 3.1 Pro: which coding model to run in July 2026
The pick is not the same model for all three of you, and the split lands on workload, not on the top benchmark line. For a solo dev in Cursor doing in-repo file edits, Claude Sonnet 5 is the pick: it takes SWE-bench Pro at 63.2% against GPT-5.5's 58.6%, and through August 31 it is the cheapest generally available model in this group at $2 per million input tokens (per EdenAI). For an ops team pushing terminal-driven agents, GPT-5.5 earns the higher token bill: it leads Terminal-Bench 2.0 at 82.7%. For anyone generating front-ends or feeding a model whole codebases, Gemini 3.1 Pro wins on a 1M-token context and the top WebDev Arena Elo. Sonnet 5 launched June 30, so this is the first month you can actually price these three side by side.
One model is missing on purpose. GPT-5.6 Sol tops the frontier agent benchmarks, but it shipped June 26 as a gated preview with no public API, so it is not a July purchase decision (per TechCrunch). If you are choosing at the $50-per-million frontier tier, our agent-model guide for July 2026 covers Sol, Fable 5, and Gemini 3.5. This guide is the deployable tier: the models you can put a key against today.
The benchmark table, every cell sourced
Read this table by column, then jump to the row that matches your agent's actual job. The gaps are small in places and decisive in others.
| Model | SWE-bench Pro | Terminal-Bench 2.0 | Context (input / output) | Input price / 1M (EdenAI) |
|---|---|---|---|---|
| Claude Sonnet 5 | 63.2% | not published | 200K standard | $2 intro, then $3 |
| GPT-5.5 | 58.6% | 82.7% | not published | $5 |
| Gemini 3.1 Pro | not published | 54.2% | 1M / 65K | $2 to 200K, $4 above |
Sources: SWE-bench Pro, Terminal-Bench 2.0, and Gemini's context figures per EdenAI, July 2. Sonnet 5 pricing and the 200K standard Claude context window per Anthropic. GPT-5.5 and Gemini 3.1 Pro pricing per EdenAI's July 2 rate card. A dash means the benchmark was not published for that model in EdenAI's table, which is itself the story: no single leaderboard ranks all three, so the pick has to follow the workload.
A second read on those coding numbers, since two benchmarks tell different stories. On SWE-bench Verified, the 500-task human-validated set, GPT-5.5 leads at 88.7% with Gemini 3.1 Pro at 80.6% and Sonnet 5 at 72.7% (per EdenAI). On the harder SWE-bench Pro, Sonnet 5 flips ahead of GPT-5.5. Verified is closer to a clean issue-resolution task; Pro leans on the messy, multi-file edits a repo agent actually hits. That is why the in-repo pick below is Sonnet 5 and not the Verified leader.
In-repo file editing: Claude Sonnet 5
If your agent lives inside a repo, reading files, planning a change, and writing a diff across several of them, Sonnet 5 is the pick. The case is the SWE-bench Pro margin: 63.2% against GPT-5.5's 58.6% (per EdenAI), on the benchmark that most resembles real file-editing work. Anthropic's own framing backs the workload fit: Sonnet 5 scores 63.2% on its agentic coding eval against Sonnet 4.6's 58.1% and Opus 4.8's 69.2% (per TechCrunch), so you get within six points of the flagship at a fraction of the price.
The candid con is that Sonnet 5 is not the SWE-bench Verified leader. If your bar is the cleanest possible single-issue resolution and cost is no object, GPT-5.5's 88.7% Verified is the higher raw number. For the day-to-day repo agent that touches five files and reruns the tests, Pro is the truer signal, and the price gap makes the call easy.
Here is the Anthropic Messages API call an in-repo agent makes, using the claude-sonnet-5 model string from Anthropic's docs:
curl -s https://api.anthropic.com/v1/messages \
-H "x-api-key: <ANTHROPIC_API_KEY>" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{
"model": "claude-sonnet-5",
"max_tokens": 2048,
"messages": [{"role": "user",
"content": "Fix the failing test in src/auth/session.ts and return a unified diff."}]
}'
Terminal and shell agents: GPT-5.5
For an agent that drives a shell, chaining commands, reading output, and correcting across many turns, GPT-5.5 is the pick. It leads Terminal-Bench 2.0 at 82.7%, and Gemini 3.1 Pro sits far back at 54.2% (per EdenAI). Sonnet 5 has no published Terminal-Bench 2.0 score in that table, so on the eval that matches shell work, GPT-5.5 is the one with the receipt.
Where it flips: this is the workload where GPT-5.5's $5 input and $30 output (per EdenAI) actually earn their premium, and the only one. If your terminal agent runs a handful of long autonomous sessions a day rather than thousands of cheap turns, the per-task cost of the stronger shell model is small next to the cost of a failed run. Route the shell steps to GPT-5.5, and keep the rest of the pipeline on something cheaper. The call against OpenAI's Responses API:
curl -s https://api.openai.com/v1/responses \
-H "Authorization: Bearer <OPENAI_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5.5",
"input": "Run the test suite, read the failures, and fix the flaky integration test."
}'
Front-end generation: Gemini 3.1 Pro
For UI and web-app generation, Gemini 3.1 Pro is the pick, and the margin is clean. It leads WebDev Arena at 1,487 Elo and posts a top LiveCodeBench Pro score of 2,439 Elo (per EdenAI). Neither Sonnet 5 nor GPT-5.5 has a WebDev Arena figure in that table that beats it. When the work is generating a component, iterating on layout, or reading a screenshot into code, Gemini's multimodal strength and front-end ranking are the reason to route here.
The candid con is the pricing cliff, not the quality. Gemini 3.1 Pro is $2 per million input up to 200K tokens, then $4 above it, with output at $12 then $18 (per EdenAI). Under 200K it matches Sonnet 5's intro input rate. Feed it a large design system or a long conversation and the bill steps up. Watch the token count on front-end sessions that drag on.
Long-document and whole-codebase pipelines: Gemini 3.1 Pro
Same winner, different reason. Gemini 3.1 Pro carries a 1M-token input context and 65K output tokens (per EdenAI), so it swallows a whole repo, a long PDF spec, or a multi-file diff without chunking. Claude's standard context is 200K (per Anthropic), which is plenty for most single-repo agents but not for dumping an entire monorepo plus its docs into one prompt.
Where it flips: if your "long document" is really a 150K-token codebase, stay on Sonnet 5. The 200K window holds it, the input rate matches Gemini's, and you keep the SWE-bench Pro edge. The 1M context earns its keep specifically when you cross 200K and cannot cleanly split the input, which is the case for a whole-monorepo review or a very long multimodal pipeline, and rarely for a routine edit.
The pricing math, and the August 31 deadline
The Sonnet 5 intro rate is a real deadline, not marketing. Through August 31, 2026, Sonnet 5 is $2 per million input and $10 per million output. After that it moves to $3 input and $15 output (per Anthropic). If you are pricing a stack now, you are pricing against the intro rate, and the cliff is dated.
Run 10 million input tokens a month through each model at sticker input rates and the spread is stark. Sonnet 5 at the intro rate: $20. Sonnet 5 after August 31: $30. Gemini 3.1 Pro under 200K per call: $20. GPT-5.5: $50 (all per the EdenAI rate card). Output moves the number more than input on any agent that writes a lot, since GPT-5.5's $30 output is triple Sonnet 5's intro $10, so a chatty terminal agent widens the gap well past that 2.5x input ratio.
# Monthly input cost at 10M tokens, sticker input rates (per EdenAI, July 2 2026).
def monthly(rate_per_mtok, mtok=10):
return rate_per_mtok * mtok
print("Sonnet 5 intro:", monthly(2.00)) # -> 20.0
print("Sonnet 5 Sep+: ", monthly(3.00)) # -> 30.0
print("Gemini <200K: ", monthly(2.00)) # -> 20.0
print("GPT-5.5: ", monthly(5.00)) # -> 50.0
One caveat that trips up anyone benchmarking raw token counts. Sonnet 5 uses an updated tokenizer, so the same input maps to roughly 1.0 to 1.35x more tokens than Sonnet 4.6, depending on content type. Anthropic set the intro price so the switch is roughly cost-neutral (per Anthropic). If you compare Sonnet 5's token bill to your old Sonnet 4.6 numbers without accounting for that, the count looks inflated. Compare on cost per task, not on raw tokens.
Setting the model in each tool
The decision lands in a model picker, and each tool exposes it differently.
In Cursor, the model is a per-session switch. Cursor Pro is $20 per month and includes access to frontier models (per Cursor), so once you are on Pro you flip between Sonnet 5, GPT-5.5, and Gemini per task at no added per-switch cost inside the IDE usage pool. Pick the model from the composer dropdown, and for a repo-editing session, leave it on Sonnet 5.
In Cline, the model routes to your own API key. Cline is open source, so the model choice here is a config setting pointing at whichever provider key you hold. Set the default to claude-sonnet-5 for repo work and override to gpt-5.5 on the shell-heavy tasks; you pay the provider's API rate directly, not a tool markup.
In n8n, the routing lives inside the AI Agent node. Each node takes its own model config, so a single workflow can cascade cheap turns and reserve the expensive model for the steps that need it. That per-node control is exactly what makes the budget stack below work: classify and extract on Sonnet 5, escalate only the hard edit.
In Claude Code, Sonnet 5 is already the default, since it is the default model on Anthropic's own plans (per Anthropic). No routing to configure; you are on the in-repo pick out of the box.
The verdict, by who you are
Three builders, three binding constraints, three picks.
If you are a solo dev on Cursor Pro, run Sonnet 5 as your default. It wins the in-repo benchmark that matches your day, it is the cheapest deployable option through August 31, and your $20 Pro seat already covers switching to GPT-5.5 on the rare shell-heavy task or to Gemini for a front-end sprint (per Cursor). The one date on your calendar: re-check the math after August 31, when Sonnet 5 moves to $3 input.
If you are an ops team running n8n workflows past 10,000 executions a month, cascade. Default the AI Agent nodes to Sonnet 5 for classify, extract, and edit steps, and route only the terminal-driven steps to GPT-5.5, where its 82.7% Terminal-Bench 2.0 lead earns the higher output rate (per EdenAI). At that volume the output-token spread between $10 and $30 is your biggest line item, so send only what needs the premium model to it.
If you are a dev shop self-hosting inference and pricing the leanest agent stack, here is the number. Run n8n Community Edition, which is free to self-host, on a Cloudways box. The entry Micro plan is $14 a month for a 1GB DigitalOcean-backed instance (per Cloudways). Point the n8n AI Agent node at Sonnet 5 through the Anthropic API at $2 per million input tokens (per Anthropic), and your fixed cost is that $14 plus per-task tokens. It is the cheapest capable agent stack we can price right now. Reserve Gemini 3.1 Pro for the jobs that cross 200K tokens of context, and keep a GPT-5.5 key on hand for the shell agent. Re-run the fixed-cost math the first week of September, because the Sonnet 5 side of it goes up by half.