GLM is the only environment in this reference built on two sides at once, and both are official, not a fallback for one another. The first is its own ZCode environment: the config lives in ~/.zcode/v2/config.json, but it is mostly edited not by hand through the file but through the UI, and it has its own ZCode subagents. The second side is the same model wired in as a backend to Claude Code through an Anthropic-compatible API at api.z.ai; in that case orchestration is no longer taken from GLM but from the host, which is to say it works exactly as described in the Claude Code section. The model behind both sides is GLM-5.3: an MoE architecture, agentic by nature, with an explicit emphasis on tool use.
Wiring into Claude Code technically comes down to a handful of environment variables: the base URL points to the Z.ai endpoint, a token authorizes requests, and the opus, sonnet and haiku models Claude Code expects by default are remapped to glm-5.3 and to the lighter glm-5.3-flash. Once this is set up, Claude Code keeps working exactly as usual - the same CLAUDE.md, the same subagents, the same summary contract - except under the hood it is GLM answering every request, not Claude.
If what is needed instead is its own environment with its own subagents rather than host orchestration, the choice is obvious - ZCode: there GLM runs both the shell and the subagents on its own, without going through Claude Code.
The official resources in this section cover both sides: the guide to setting up Claude Code with GLM for the host-orchestration option, the ZCode site and its subagents docs for the environment's own path, and the GLM-5.3 docs together with the card for the earlier GLM-4.6 for the architectural side of the question. A caveat is worth making here: the GLM-4.6 card among the sources is not the version immediately preceding GLM-5.3 - the direct predecessor of GLM-5.3 is GLM-5.2 - and the earlier 4.6 card is worth reading as a general picture of the lineage's architecture rather than as a precise description of the immediately prior version.
The ready block of environment variables below is a working recipe specifically for wiring GLM into Claude Code: the base URL, the token, and the remapping of three models. If what is needed instead is GLM's own ZCode environment, these variables are not needed at all, and configuration runs through ~/.zcode/v2/config.json and the UI mentioned above.
# GLM in Claude Code - Anthropic-compatible API.
# Guide: docs.z.ai/devpack/tool/claude
export ANTHROPIC_BASE_URL="https://api.z.ai/api/anthropic"
export ANTHROPIC_AUTH_TOKEN="<your Z.ai key>"
export ANTHROPIC_DEFAULT_OPUS_MODEL="glm-5.3"
export ANTHROPIC_DEFAULT_SONNET_MODEL="glm-5.3"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="glm-5.3-flash"
# GLM's own environment: ZCode (zcode.z.ai). Otherwise - host
# CLAUDE.md/subagents (pattern - see the Claude Code section).