Skip to main content

GLM-5.4 vs Claude Opus 5.5: Can GLM-5.4 Replace Claude Code?

GLM-5.4 runs inside Claude Code and nearly matches Opus 5.5 on KingBench 4, but it thinks far longer and has no API yet. Here is how the two compare.
Tom Farnschläder
Tom Farnschläder

Create Your Free Account

Practice and track your progress.

Continue with GoogleBy continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.

Z.ai released GLM-5.4 on November 23, 2026, and pitched it as a coding model from the first line of its announcement. Its documentation goes a step further: it shows you how to point Claude Code at Z.ai's servers and swap Claude Opus 5.5, the model Anthropic recommends for most work, for GLM-5.4. So the question developers are asking is a practical one: can GLM-5.4 replace Opus 5.5 as the model behind Claude Code?

In this article, I'll compare GLM-5.4 and Claude Opus 5.5 across coding behavior, GLM-5.4's loop transformer architecture, speed, and what each costs you per month.

To keep up with the AI and data space, I recommend subscribing to our weekly newsletter, The Median.

Since the question here is whether GLM-5.4 can run behind Claude Code, the Claude Code in Action course covers how to steer long sessions, set rules with hooks, and verify what comes back, whichever model you run.

TL;DR

  • GLM-5.4 can't replace Opus 5.5 one-to-one as your main Claude Code model yet: it trails slightly on the one shared benchmark and has no API.
  • GLM-5.4 is the best-scoring open model on that benchmark and an unusually careful bug hunter.
  • It overthinks: GLM-5.4 takes far more steps per task, and its top effort levels can time out on short jobs.
  • Choose Opus 5.5 for daily agentic coding, production APIs, and cloud deployment.
  • Choose GLM-5.4 as a second reviewer or planner inside Claude Code, on a GLM Coding Plan.
  • The loop transformer is the most interesting idea here: more depth without more parameters.

What Is GLM-5.4?

GLM-5.4 is Z.ai's flagship model, released in November 2026 to GLM Coding Plan subscribers, with API access and open weights promised for later.

Its selling point is the loop transformer architecture: it runs a block of its layers twice per token, which Z.ai says lets a roughly 750B-parameter model reason like a 2T to 3T one.

Our GLM-5.4 guide covers the launch in detail.

What Is Claude Opus 5.5?

Claude Opus 5.5 is Anthropic's closed-weight flagship and the first model in its Claude 5.5 family.

Anthropic positions it as Claude Fable 5.1-level performance on most work at a much lower running cost than Opus 5, and its docs name it the default starting point for most workloads.

Our Claude Opus 5.5 guide covers the launch; our Opus 5.5 API tutorial walks through building with it.

GLM-5.4 vs Claude Opus 5.5: Head-to-Head Comparison

GLM-5.4 lands within 1.5 points of Opus 5.5 on KingBench 4

On the one independent benchmark that ran both models, Opus 5.5 finishes slightly ahead, and the only other differences are reach and behavior. GLM-5.4 matches Opus 5.5 on context but can only be used through Z.ai's subscription for now.

FeatureGLM-5.4Claude Opus 5.5
DeveloperZ.aiAnthropic
WeightsOpen weights planned, not releasedClosed
ArchitectureLoop transformer, about 750B parameters, 28 layers run twiceNot disclosed
KingBench 4 (independent, max effort)33.2 out of 60, 7th of 1934.7 out of 60, 4th of 19
Vendor coding benchmarksNone publishedTerminal-Bench 4.0 66.4%, FrontierCode 54.4%, CursorBench 57.8%
Context window / max output1M / 128K tokens1M / 128K tokens
Input typesText, image, video, fileText, image
Output speedUp to 200 tokens/s off-peak, 70–80 tokens/s at peakOver 30% faster than Opus 5 (no absolute figure)

Coding in Claude Code: close on score, different in behavior

Opus 5.5 leads GLM-5.4 by 1.5 points on KingBench 4, the only benchmark so far that has run both. It is AICodeKing's suite of 6 full app builds, from a Rust Game Boy and DS emulator to a playable Pokémon Red, each scored out of 10. A 1.5-point gap on a 60-point scale is close to a tie on raw output, and GLM-5.4 is the highest-scoring open model on the board.

Take those totals with salt:

  • KingBench 4 is one tester's own harness, and GLM-5.4 ran on early access.
  • Z.ai has published no standard benchmark for GLM-5.4, so Anthropic's Terminal-Bench 4.0, FrontierCode, and CursorBench results have nothing to line up against.

The behavior is where they split. In his write-up, AICodeKing calls GLM-5.4 "the most careful model that I have ever used": it found bugs and security vulnerabilities in his apps that other models, Claude Fable 5.2 included, had missed. He keeps it in a "council of reviewers" before shipping, but wouldn't use it as his only coder. It fails 1.56% of tool calls, 11th of 17 in his comparison, yet 66% of those failures are followed by a working retry, better than every Claude and Codex model he tested.

Anthropic's evidence for Opus 5.5 is about finishing large jobs: an internal C-to-Rust translation of HAProxy finished in 9.5 hours, and a classifier screens every action before it runs. For writing code all day in Claude Code, Opus 5.5 is the stronger pick; GLM-5.4 earns its place reviewing that code.

Architecture: GLM-5.4's loop transformer

A loop transformer runs a block of weight-shared layers more than once per token, so the network gets deeper without gaining parameters. Anthropic discloses nothing about Opus 5.5's internals, so this section is about GLM-5.4 alone, and I think it is the most interesting part of the release.

According to Z.ai's architecture diagram, each token passes through three stages:

  • Prelude: layers 1 to 26 run once.
  • Loop: layers 27 to 54 run twice with the same weights, which is the "28 layers for two iterations" in Z.ai's description.
  • Coda: layers 55 to 78 run once before the output head.

That is 106 layer passes from 78 layers of weights. The idea goes back to the 2018 Universal Transformer, but looped models trained from scratch lag behind regular ones, so Z.ai converted its existing GLM-5 base model through continued training instead. Three changes keep the second pass stable and affordable:

  • Gated updates. A per-token gate decides how much each pass writes back. The first pass writes cautiously, the second writes fully, and harder tokens get a bigger first-pass write. Without the gates, activations blow up across passes.
  • A hybrid key-value (KV) cache. The second pass reuses the first pass's cache and keeps only its own 128-token sliding window, so the extra loop costs one small window of memory instead of a second full cache at 1M tokens of context.
  • Reused sparse-attention indices. The second pass reuses the 2,048 positions the first pass selected, adding no indexing cost.

Z.ai's evidence that looping pays off comes from a 30B test model with the same architecture, trained with about 10% more compute than an identical model without the loop:

Benchmark (30B test model)Without loopWith loopGain (points)Output length change
AIME2519.1730.4211.3-2%
GPQA-Diamond47.5856.268.7-11.7%
AA-LCR40.3347.677.3-9.7%
MMLU-Pro71.6575.053.4-14.9%
IFBench50.2053.473.3-13.0%

The gains are largest in math, science, and long-context reasoning, and they come with shorter answers, as if part of the thinking moved inside the loop. Z.ai also admits the cost: GLM-5.4 "tends to get caught in overly long 'marathon thinking' loops." If you want the transformer basics first, our guide to how transformers work covers them.

Speed and thinking: GLM-5.4 takes far more steps

GLM-5.4 isn't slow per token, but it takes more steps. AICodeKing's KingBench 4 run took 431 minutes against 109 for Gemini 4 Neon, with similar time per step but 1,128 steps against 244, and it reasoned on almost every one. Nobody has published a matching timing for Opus 5.5.

Effort settings matter more than usual. Z.ai's Claude Code setup defaults to max effort, yet on AICodeKing's short tasks with a 180-second limit, both High and Max timed out while still thinking, and he calls High "the best sweet spot." If you try GLM-5.4, lower /effort before blaming the model.

Context and inputs: a tie on paper

Both models offer a 1M-token context window and 128K output tokens, and both read images. GLM-5.4 also accepts video and files, which matters little for coding. Getting the full 1M context in Claude Code takes one extra setting for GLM-5.4, covered in the setup section below.

Pricing: what you actually pay

Opus 5.5 is the only one of the two with per-token prices, because GLM-5.4 has no API yet. For Claude Code users, the real comparison is the monthly subscription.

GLM Coding Plan and Claude plans cost about the same at every tier

Both vendors price their coding plans within a few dollars of each other. The difference is in what the quota buys, which neither side states in comparable units.

Token rates side by side

Opus 5.5's rates come from Anthropic's pricing page; Z.ai says GLM-5.4's API opens after a security assessment.

RateGLM-5.4Claude Opus 5.5
Input, per 1M tokensNot published (no API yet)$4.00
Output, per 1M tokensNot published (no API yet)$20.00
Cached input read, per 1M tokensNot published$0.20
Fast mode, input / output per 1M tokensNot applicable$8.00 / $40.00

Opus 5.5 is no longer available with thinking switched off, so plan for reasoning on every call. Anthropic says cache reads make up most of the cost of agentic and coding work, which makes the cached rate matter more than the headline rates.

What a month of coding costs

Without GLM-5.4 API rates, a per-token workload comparison isn't possible yet. Here are the plans that put each model in Claude Code, at monthly list prices:

TierGLM Coding PlanClaude plan
EntryLite, $18/monthPro, $20/month
MidPro, $80/month (6x Lite usage)Max, $100/month (5x Pro usage)
TopMax, $168/month (14x Lite usage)Ultra, $200/month (10x Pro weekly usage, no 5-hour limit)
Annual billing30% off: $12.60, $56, or $117.60 per monthPro $17/month ($200 up front)

The yearly GLM Lite plan is the cheapest paid plan for either model, and Z.ai charges half the usage credits off-peak. Claude Max and Ultra add $100 and $200 a month of API credits, which no GLM plan includes. Both vendors use 5-hour and weekly limits; our guide to Claude Code usage limits explains how Anthropic's work.

Neither vendor publishes how many tasks a plan's quota covers for these two models, so treat this table as a list-price comparison rather than value per dollar.

When to Choose GLM-5.4 vs Claude Opus 5.5

Opus 5.5 writes the code; GLM-5.4 reviews it

The fork is access as much as quality: GLM-5.4 only runs inside supported tools on a Z.ai subscription. That rules it out of any pipeline that calls a model API.

Choose GLM-5.4 if...

  • You want a second set of eyes before shipping. GLM-5.4's caution makes it a strong reviewer for bugs and security issues that a faster model walks past.
  • You are planning a large architecture change. AICodeKing rates it as a good planner that "gets the bigger picture," and its long thinking suits that work better than quick edits.
  • You want the cheapest entry plan. The yearly GLM Lite plan undercuts Claude Pro, and it works inside Claude Code.

Choose Claude Opus 5.5 if...

  • It's your main coding agent. Opus 5.5 scores higher on KingBench 4, and Anthropic reports it audited and fixed a 200,000-line codebase in under 3 hours.
  • You need an API. CI jobs, internal tools, and agents built on the Claude Platform can call Opus 5.5 today; GLM-5.4 has no API yet.
  • You deploy through a cloud provider. Opus 5.5 is on Amazon Bedrock, Google Vertex AI, and Azure AI Foundry.
  • You run agents unattended. Opus 5.5 ships with an action classifier and an open-source sandbox, and it ties Fable 5.1 for the lowest prompt-injection success rate on Gray Swan's benchmark.

How to Get Started With GLM-5.4 and Claude Opus 5.5

Opus 5.5 is available almost everywhere, while GLM-5.4 is limited to Z.ai's subscription and the tools it supports.

SurfaceGLM-5.4Claude Opus 5.5
Consumer appZ.ai Chat, ZCodeClaude apps
Coding subscriptionGLM Coding Plan (Lite, Pro, Max)Claude Pro, Max, Ultra
First-party APINot yet, pending Z.ai's security assessmentClaude Platform
Coding agentsClaude Code, ZCode, Codex, OpenCode, Cursor, Cline, and other tools Z.ai supportsClaude Code, GitHub Copilot
Cloud platformsNot yet available as of November 23, 2026Amazon Bedrock, Google Vertex AI, Azure AI Foundry
OpenRouterNot yet available as of November 23, 2026anthropic/claude-opus-5.5
Model IDglm-5.4 (glm-5.4[1m] for 1M context in Claude Code)claude-opus-5-5

The model IDs to type are glm-5.4 in most tools and claude-opus-5-5 on the Claude Platform.

Using GLM-5.4 and Claude Opus 5.5 in a coding agent

Switching Claude Code from Opus 5.5 to GLM-5.4 is a settings change, following Z.ai's model-switching guide. Add these keys to ~/.claude/settings.json, then check /status:

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.z.ai/api/anthropic",
    "ANTHROPIC_AUTH_TOKEN": "your_zai_api_key",
    "API_TIMEOUT_MS": "3000000",
    "CLAUDE_CODE_AUTO_COMPACT_WINDOW": "1000000",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "glm-5.4[1m]",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "glm-5.4[1m]",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "glm-5.4[1m]"
  }
}

Remove those keys to go back to Opus 5.5 on your Claude plan. To run GLM-5.4 as a reviewer rather than a replacement, keep it in a second agent such as OpenCode, and use our tutorial on code review with Claude Code for the review workflow.

Final Thoughts

GLM-5.4 can't replace Opus 5.5 in Claude Code yet, even though it comes close on the one shared benchmark. It thinks for far longer, has no API, and Z.ai hasn't published the scores that would make a stronger case. If you write code all day in Claude Code, stay on Opus 5.5. If you ship code where a missed vulnerability is expensive, add GLM-5.4 as a reviewer.

What I find most interesting is the loop. Z.ai converted an existing model into a deeper one instead of training a bigger one, and says a much larger model built the same way is close. That one will be the real test of whether GLM can match Opus as a primary coder.

If you're keen to get more out of either model in your terminal, I recommend our Software Development with Claude Code course.

FAQs

Can GLM-5.4 replace Claude Code?

GLM-5.4 can run inside Claude Code through Z.ai's Anthropic-compatible endpoint, so the real question is whether it can replace Claude Opus 5.5. Not yet: Opus 5.5 scores slightly higher on KingBench 4, is on every major cloud, and has an API. GLM-5.4 works best as a careful second reviewer for bugs and security issues.

Is GLM-5.4 better than Claude Opus 5.5 for coding?

No. On AICodeKing's independent KingBench 4, Claude Opus 5.5 scores 34.7 out of 60 and GLM-5.4 scores 33.2, the best result for an open model. Z.ai has published no standard benchmarks for GLM-5.4, so that third-party board is the only direct comparison available in November 2026.

How do I use GLM-5.4 in Claude Code?

Subscribe to a GLM Coding Plan, create a Z.ai API key, and set ANTHROPIC_BASE_URL to https://api.z.ai/api/anthropic in ~/.claude/settings.json. Map the Opus, Sonnet, and Haiku model slots to glm-5.4[1m] for 1M context, then confirm with /status. The default effort is max; lower it with /effort.

Does GLM-5.4 have an API?

Not yet. Z.ai says the GLM-5.4 model API opens after a security assessment, and it has published no per-token prices. For now, GLM-5.4 is available through the GLM Coding Plan in supported tools like Claude Code, ZCode, and OpenCode, plus Z.ai Chat. Open weights are also planned but not released.

What is the loop transformer in GLM-5.4?

A loop transformer runs a block of shared layers more than once per token. GLM-5.4 runs layers 27 to 54 twice, giving 106 layer passes from 78 layers of weights. Z.ai says this lets a roughly 750B-parameter model reason like a 2T to 3T one, though it can overthink.

Tom Farnschläder

Author

Tom Farnschläder

Tom is a Data Science Editor at DataCamp. He writes and edits AI tutorials, compares new LLM releases, and builds AI-powered workflows. Previously, he worked in data science at Deutsche Telekom. Outside of work, he forecasts football matches with machine learning.

Topics

Related