All Posts
AI Engineering July 11, 2026
Grok 4.5vs Opus 4.8

Grok 4.5 vs Opus 4.8: Agentic Coding on SWE-Bench Pro and Terminal-Bench Tested (July 2026)

The headline is that Opus 4.8 wins SWE-Bench Pro and Grok 4.5 wins Terminal-Bench, but the score line is the least interesting part of this matchup. The number that should change how you route work is token efficiency: on the same SWE-Bench Pro tasks Grok 4.5 spent roughly a quarter of the output tokens Opus 4.8 did, at less than a third the output price. We break down where each model actually wins, why the benchmark split is real rather than noise, and how to think about cost per completed issue instead of leaderboard rank.

Grok 4.5 vs Opus 4.8: Agentic Coding on SWE-Bench Pro and Terminal-Bench Tested (July 2026)

If you run an agent that writes and fixes code all day, the question is not which model tops a leaderboard. It is which model closes more of your tickets per dollar, and the answer for Grok 4.5 versus Claude Opus 4.8 is genuinely split. One wins repository scale bug fixing, the other wins terminal driven agentic tasks, and the pricing gap between them is wide enough that the ranking on capability and the ranking on cost point at different models. Here are the reported numbers, then the reasoning that turns them into a routing decision.

Metric Grok 4.5 Opus 4.8
SWE-Bench Pro 64.7% 69.2%
Terminal-Bench 2.1 83.3% 78.9%
Avg output tokens per SWE-Bench Pro task ~15,954 ~67,020
Input price, per 1M tokens $2.00 $5.00
Output price, per 1M tokens $6.00 $25.00

Read the token row before the score rows. On the same SWE-Bench Pro suite where Opus 4.8 posts the higher pass rate, it also spent roughly 4.2 times the output tokens per task that Grok 4.5 did. Output tokens are the expensive half of an agent bill, and Grok prices them at less than a third of Opus. Multiply those two facts together and the cost per attempt gap is close to an order of magnitude, which is why the accuracy delta of a few points does not tell you who is cheaper to run.

The Benchmark Split Is Real, Not Noise

A four to five point swing in opposite directions on two coding benchmarks looks like variance until you look at what the benchmarks actually measure. SWE-Bench Pro asks a model to fix a real issue inside a large existing repository: read a sprawling codebase, localize the fault, and produce a patch that passes the hidden tests. It rewards deep code comprehension and the patience to trace a bug across many files. Opus 4.8 leading here, at 69.2 percent against Grok 4.5 at 64.7 percent, is consistent with its reputation for repository scale reasoning and its willingness to spend a lot of tokens exploring before it commits.

Terminal-Bench 2.1 measures something different. It scores a model acting as an agent in a shell: running commands, reading output, installing dependencies, recovering from errors, and driving a task to completion across many turns. That rewards fast, decisive tool use and tight loops more than it rewards long contemplative reasoning. Grok 4.5 winning here, at 83.3 percent against 78.9 percent, fits its design center of quick serving and low token spend per step.

So the split is not a coin flip. It is a signal about which kind of work each model is built for. If your agent mostly localizes and patches bugs in a mature codebase, Opus 4.8 has the edge on raw success. If your agent mostly drives a terminal, wiring up environments, running migrations, or orchestrating build and test loops, Grok 4.5 both wins the benchmark and costs far less to run. We saw a similar shape when we compared Sonnet 5 and Opus 4.8 on cost per issue, where the higher scoring model was not the cheaper one per closed ticket.

Why Token Efficiency Beats Pass Rate for Most Teams

The industry trained itself to read the pass rate column first because that is the number vendors put in the press release. For a team paying the bill, it is the wrong first screen. What you actually spend is a product of three things: the price per output token, the number of output tokens the model burns per attempt, and how many attempts it takes to close the issue.

Grok 4.5 wins two of those three decisively. At roughly 15,954 output tokens per SWE-Bench Pro task against about 67,020 for Opus 4.8, and at $6 per million output tokens against $25, its cost per attempt on this suite is dramatically lower. The one place Opus claws back is the third factor, attempts per closed issue, because a higher pass rate means fewer retries. Model that out honestly and the crossover depends entirely on your retry policy and how much a wrong patch costs you downstream.

def cost_per_closed_issue(pass_rate, out_tokens, out_price_per_m, in_tokens, in_price_per_m):
    # expected attempts to close one issue, assuming independent retries
    attempts = 1 / pass_rate
    per_attempt = (out_tokens * out_price_per_m + in_tokens * in_price_per_m) / 1_000_000
    return round(attempts * per_attempt, 4)

# illustrative input token counts for a repo-scale task
grok = cost_per_closed_issue(0.647, 15_954, 6.00, 40_000, 2.00)
opus = cost_per_closed_issue(0.692, 67_020, 25.00, 40_000, 5.00)
print("Grok 4.5:", grok, "Opus 4.8:", opus)

Run that with your own token counts, not the illustrative input figure above, and the pattern holds across a wide range: Grok 4.5 comes out several times cheaper per closed issue on this workload even after paying for its slightly higher retry rate, because the token spend and output price advantages are so large. The assumption that retries are independent is generous to neither model and real pipelines cap attempts, but the direction holds regardless of those details. Pass rate matters most when a wrong answer is expensive to catch, for example an unattended agent merging its own patches. When a human reviews every diff, the cheaper model that needs one extra try is usually the better economic choice.

Where Each Model Earns Its Place

Reach for Opus 4.8 when correctness on the first pass carries real cost. Autonomous refactors across a large repository, security sensitive changes, or any loop where a bad patch propagates before a human sees it are worth the premium and the extra tokens. Its edge on SWE-Bench Pro is a proxy for exactly that deep, multi file comprehension, and the willingness to spend tokens exploring is a feature when the task genuinely needs it. We covered its behavior against another Anthropic model on Terminal-Bench in the Opus 4.8 versus Fable 5 comparison.

Reach for Grok 4.5 when volume and iteration speed dominate. High throughput agent fleets, terminal driven automation, CI and build orchestration, and any workload where you run thousands of cheap attempts and gate them behind tests will get more done per dollar on Grok. Its Terminal-Bench lead plus its token frugality make it the default for the wide, fast, tool heavy end of the spectrum. This is a continuation of the trajectory we noted in the earlier Grok versus Opus 4.8 matchup, where the cost story kept widening in xAI's favor even as Anthropic held the quality crown.

The most sophisticated answer is not to pick one. Route terminal and orchestration steps to Grok 4.5, escalate to Opus 4.8 only for the deep localization and patch steps where its pass rate earns the token premium, and gate everything behind your own tests. A tiered agent that spends premium tokens only on the hard middle of a task, not on the whole loop, will beat a single model deployment on both cost and quality.

When This Applies to Your Stack

If you are building or scaling a coding agent, do not standardize on a model from a benchmark headline. Pull a sample of your real tickets, run both models against them, and measure the only number that matters: fully verified cost per closed issue, including retries and human review time. You will almost certainly find that the capability leader and the cost leader are different models, and that the right architecture routes cheap high volume steps to one and hard reasoning steps to the other.

If your team wants that routing, token budget, and escalation logic designed and implemented against your own codebase and ticket mix rather than a vendor's benchmark, Contra Collective builds AI integration and agent engineering that holds margin as it scales. The models will keep leapfrogging each other; the discipline of measuring cost per completed task on your own work is what survives every release.

FAQ

Is Grok 4.5 or Opus 4.8 better for coding? Neither wins outright. Opus 4.8 leads SWE-Bench Pro at 69.2 percent versus 64.7 percent, which measures repository scale bug fixing, while Grok 4.5 leads Terminal-Bench 2.1 at 83.3 percent versus 78.9 percent, which measures shell driven agentic tasks. Match the model to the shape of your work.

Why is Grok 4.5 so much cheaper to run? Two reasons compound. It prices output tokens at $6 per million against Opus 4.8 at $25, and on SWE-Bench Pro it used roughly 15,954 output tokens per task against about 67,020 for Opus, a 4.2 times gap. Lower price per token multiplied by fewer tokens per task produces a very large cost difference per attempt.

Does the higher pass rate make Opus 4.8 cheaper per closed issue? Only when retries are expensive. A higher pass rate means fewer attempts to close an issue, which offsets some of Grok's cost advantage, but the token and price gaps are large enough that Grok 4.5 still comes out cheaper per closed issue across most reasonable retry assumptions. Opus wins the economics only when a wrong first patch carries serious downstream cost.

Can I use both models in one agent? Yes, and for most teams it is the best answer. Route terminal, orchestration, and high volume steps to Grok 4.5, escalate to Opus 4.8 for deep localization and patch generation, and gate all output behind your test suite. A tiered design spends premium tokens only on the hard part of the task.

Are these benchmark numbers from real tests? The pass rates and token figures cited here are the reported SWE-Bench Pro and Terminal-Bench 2.1 results circulating at the time of writing. Treat them as a starting point and validate on your own tickets, because public benchmark performance and your workload can diverge sharply.

[ 02 ] — Keep Reading

More from the lab.

Nov 7, 2026 AI Engineering

Postman's MCP Plugin Installed Itself Into Claude Code and Codex: What the Audit Trail Actually Shows

A developer running Postman Desktop 12.33.4 on macOS found their Claude Code settings and Codex config both quietly enabled with Postman's MCP plugin, logged under a source string that does not appear anywhere in Postman's public plugin repository. The GitHub issue, filed October 25, 2026, has sat open and unanswered. No data breach is proven here, the MCP server failed authentication in the reported case, but the consent gap is real and it is a pattern worth auditing for in your own agentic coding stack regardless of whether this specific vendor is the one that did it to you.

Nov 6, 2026 AI Engineering

Cisco Gave One Engineer Unlimited AI Tokens to Rewrite 98 Percent of Its Legacy Code

Cisco president and chief product officer Jeetu Patel gave engineer Padmanabhan Krishnamurthy, 27, unlimited AI tokens and a self set four week proof period toward a goal of rewriting 98 percent of Cisco's legacy code within 24 months, with a two person team. Fortune reported it on October 30, 2026. No results have been reported yet, the 98 percent figure is a target. The structure of the bet, not the number, is what enterprise engineering leaders should actually study.

Oct 19, 2026 AI Engineering
vs

ChatGPT Atlas vs Perplexity Comet: Which AI Browser Actually Works for Enterprise Workflows

Two AI native browsers now compete for the same enterprise seat: OpenAI's ChatGPT Atlas, which launched on Mac in October 2025 with an agent mode gated to paid plans, and Perplexity's Comet, which added a dedicated Enterprise Pro tier with SOC 2 Type II certification, admin permissioning, and MDM rollout to thousands of devices in March 2026. Both sit on Chromium and both will click through a web page on your behalf. What actually differs is who can turn the agent loose, what IT can see once they do, and whether a security team would sign off on either one today.

Ready when you are

Want to discuss this topic?

Start a Conversation