June 21, 2026 · Practical setup guide: GLM 5.2 in Claude Code + VS Code extension

GLM 5.2 in Claude Code
Setup Tutorial & Practical Guide (Rapid Research Brief)

Confidence High Sources 3 Depth Rapid Author Gambit (Hermes)
glm-5.2claude-codeopen-sourcesetup-tutorialvscodemodel-switching
▶ View Slide Deck

Executive Summary

GLM 5.2 is a 756-billion parameter open-source model that can be routed into the Claude Code harness via Z.ai’s Anthropic-compatible API, delivering roughly 5x cheaper inference than Opus 4.8. Nate Herk’s tutorial demonstrates a full day of real-world testing: design tasks, creative one-shot builds, storm research, and coding — with GLM 5.2 handling ~80% of knowledge work competently and Opus reserved for the 10–20% that demand heavy reasoning. Setup is a single JSON config drop into .claude/settings.local.json. Per-project model switching is achieved by placing different config files in different directories — open Claude Code in the GLM folder to use GLM, open it in a folder without the config to use your default Opus subscription. The VS Code extension inherits the same settings, so once configured, GLM 5.2 works in the IDE exactly like any other model. The practical takeaway: models are engines, Claude Code is the harness — learn to switch engines per task, not per project.

Key Takeaways

Tutorial: Step-by-Step Setup

1 Get Your Z.ai API Key

Step 1: Go to z.ai and create an account. You can try GLM 5.2 directly in their web chat first — it supports landing page generation, 3D modeling, mini-games, and front-end design.

Step 2: Choose a plan or pay-per-token. Plans: $16/mo, $64/mo, $144/mo (yearly discount available). Pay-per-token: $1.40/M input, $4.40/M output. Nate’s recommendation: pair a $100 Claude plan with a $64 Z.ai plan and switch between them per task.

Step 3: In the Z.ai console, go to API Keys and create a new key. Copy it — you’ll paste it into the Claude Code config.

2 Configure Claude Code

This is the core setup. Create or edit .claude/settings.local.json in your project root (or global config). Drop in this JSON block, replacing the API key with yours:

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.z.ai/api/anthropic",
    "ANTHROPIC_AUTH_TOKEN": "your-z-ai-api-key",
    "ANTHROPIC_API_KEY": "",
    "API_TIMEOUT_MS": "3000000",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "glm-5.2",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "glm-5.2",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "glm-5.2",
    "ANTHROPIC_SMALL_FAST_MODEL": "glm-5.2",
    "CLAUDE_CODE_SUBAGENT_MODEL": "glm-5.2"
  }
}

What’s happening: ANTHROPIC_BASE_URL redirects all API calls from Anthropic’s endpoint to Z.ai’s endpoint. All model defaults are remapped to glm-5.2. The API_TIMEOUT_MS of 3,000,000 (50 minutes) accounts for GLM’s slower performance on reasoning-heavy tasks. The ANTHROPIC_API_KEY is left empty because authentication is handled via ANTHROPIC_AUTH_TOKEN with your Z.ai key.

Alternative: You can also ask Claude Code to do this: “Put this config into my settings.local.json” and paste the block. Nate provides the exact config in his video description.

3 Verify It’s Working

Open Claude Code in the project directory where you placed the config. The status bar or session header should show GLM 5.2 with 1M context — API usage billing. If you see Opus, the config isn’t being picked up — check that settings.local.json is in the correct directory (project-level .claude/ or global config path).

Quick test: run /goal with a simple task like “Build me a creative HTML page about space” and verify the model responds with GLM 5.2 quality (slightly different style from Opus, but solid).

4 Per-Project Model Switching

This is the most powerful workflow. Create two project folders:

~/projects/
  ├── glm-project/
  │   └── .claude/settings.local.json  ← GLM 5.2 config
  └── opus-project/
      └── (no settings.local.json)      ← defaults to your Claude plan

Open Claude Code in glm-project/ → uses GLM 5.2. Open in opus-project/ → uses your default Opus subscription. VS Code extension: the Claude Code extension reads the same .claude/settings.local.json per workspace. Open a VS Code workspace in the GLM folder, and the extension uses GLM. Open a workspace in the Opus folder, and it uses default Opus. No manual switching required.

When to Use GLM 5.2 vs. Opus

5 What GLM 5.2 Excels At

Creative one-shot builds: “Build me an interactive HTML page” → solid results, often faster than Opus (GLM: 3m59s vs. Opus: 14m59s for equivalent design tasks). Design work: GLM produced a landing page nearly indistinguishable from Opus in Nate’s side-by-side test. Storm research: multi-agent research with subagents, verification checks, and HTML reports — GLM handled it well because the skill orchestration mattered more than the underlying model. Documentation and boilerplate: READMEs, config files, slide decks (Nate’s entire presentation was built by GLM 5.2 using his slide deck skill). Daily knowledge work: about 80% of tasks that don’t require deep multi-step reasoning.

6 When Opus Is Still Necessary

Heavy reasoning tasks: GLM 5.2 took 24 minutes for a complex task that Opus completed in 5 minutes. Subtle edge cases: in Nate’s homework assignment test, GLM missed duplicate record handling (true vs 1, 1 vs 1.0) that Opus caught. Complex debugging: multi-step debugging with deep context and intricate logic. Strategic thinking: “Based on all this research data, what really matters and how do I apply it?” — Nate reserves this for Opus. The rule of thumb: use GLM for the 80% that’s research, design, documentation, and boilerplate. Switch to Opus for the 10–20% that requires precision reasoning.

Benchmarks & Pricing

7 Benchmarks: Where GLM 5.2 Stacks Up

GLM 5.2 is competitive with top-tier closed-source models across major benchmarks:

8 Pricing Comparison

ModelInput (/M tokens)Output (/M tokens)
Opus 4.8$5.00$25.00
GLM 5.2$1.40$4.40
Savings3.6x cheaper5.7x cheaper

Z.ai subscription plans: $16/mo, $64/mo, $144/mo. Nate’s 5-hour heavy usage session on the $60/mo plan consumed roughly half his 5-hour quota and 10% of his weekly quota — plenty of headroom for daily knowledge work.

Risks, Gaps & Uncertainty

Recommended Next Actions

1

Run the 5-minute setup. Create a Z.ai account (free tier available), grab an API key, drop the config into .claude/settings.local.json. Test with a simple /goal prompt. Verify GLM 5.2 appears in the session header.

2

Set up per-project model switching. Create a glm-projects/ folder with the GLM config, keep your main projects on default Opus. Open VS Code workspaces accordingly. Get comfortable with “which model for which task.”

3

Run a side-by-side comparison. Take one real task from your workflow. Run it through GLM 5.2 and Opus. Compare: time, cost, quality. Build your own intuition for when GLM is sufficient vs. when Opus is necessary.

4

Test with your existing skills and agents. If you use Claude Code skills, MCP servers, or agent teams, verify they work correctly with GLM 5.2. Nate confirmed his storm research skill and slide deck skill worked — your mileage may vary with custom skills.

5

Track cost savings. Compare your API billing between GLM-only days and Opus-only days. Use the 80/20 rule: GLM for the majority, Opus for the critical. Target 3–5x cost reduction on daily knowledge work.

Annotated References

[1] Herk, N. (2026). GLM 5.2 in Claude Code is Blowing My Mind. YouTube. Watch

Primary source. Full day of testing GLM 5.2 in Claude Code: design tasks, creative builds, storm research, coding. Complete setup walkthrough with config, pricing, benchmarks, and per-project switching.

[2] Z.ai. (2026). GLM 5.2 API Console & Documentation. Visit

Official API platform for GLM 5.2. Pricing, plans, API keys, and Anthropic-compatible endpoint documentation.

[3] Anthropic. (2026). Claude Code Documentation — Settings & Configuration. View

Official documentation for Claude Code settings, environment variables, and model configuration. Reference for settings.local.json structure.


Methodology · Rapid (research-rapid v1.0) · Full transcript analysis · 3 sources · High confidence · DeepSeek V4 Pro · June 21, 2026