How to use GLM-5.2 in DevAgent ADE
Configure Claude Code and other CLI agent harnesses to run GLM-5.2 inside DevAgent worktrees.
GLM-5.2 works in DevAgent through the agent harness you already use. Configure GLM-5.2 in Claude Code, OpenCode, Cline, Kilo Code, Roo Code, Droid, OpenClaw, or another CLI agent, then launch that agent from DevAgent's picker.
DevAgent supplies the isolated worktree, terminal panes, browser tab, review flow, and session management. Your Z.ai CodePlan subscription and agent config supply the model access.
Prerequisite
You need an active Z.ai CodePlan subscription with GLM Coding Plan access before configuring GLM-5.2 in an agent harness. OpenAI-compatible harnesses also need a Z.ai API key. DevAgent does not include or resell GLM access.
Source
These settings follow Z.ai's latest model guide. Check that page for the current provider-side details.
Claude Code
Claude Code reads model overrides from ~/.claude/settings.json. To use GLM-5.2 in DevAgent:
- Open
~/.claude/settings.json. - Add or update the
envblock below. - Restart Claude Code sessions in DevAgent so the new environment is loaded.
- Run
/statusinside Claude Code to confirm the active model.
{
"env": {
"CLAUDE_CODE_AUTO_COMPACT_WINDOW": "1000000",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "glm-4.5-air",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "glm-5.2[1m]",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "glm-5.2[1m]"
}
}Use the [1m] suffix when you want GLM-5.2's 1M context variant, and keep CLAUDE_CODE_AUTO_COMPACT_WINDOW set to 1000000 so Claude Code's compaction window matches that context size. If Claude Code says the [1m] model does not exist, update Claude Code and try again.
For coding tasks, Z.ai recommends setting Claude Code effort to max with /effort. Claude Code's lower effort settings map to GLM-5.2 high effort, while xhigh, max, and ultracode map to GLM-5.2 max effort.
OpenCode, Cline, Kilo Code, Roo Code, and Droid
For agent harnesses that expose an OpenAI-compatible provider:
- Open the harness settings outside or inside DevAgent.
- Choose the OpenAI-compatible provider option, or the Z.ai provider option if the harness has one.
- Set the base URL to
https://api.z.ai/api/coding/paas/v4. - Add your Z.ai API key.
- Set the custom model name to
glm-5.2. - Set context window size to
1000000if the harness exposes that field. - Disable image support unless the harness specifically documents image support for this provider path.
After saving, launch the harness from DevAgent's agent picker. DevAgent will run the same configured CLI in the selected worktree.
OpenClaw
If OpenClaw cannot select GLM-5.2 directly from its provider model list, add the model manually in ~/.openclaw/openclaw.json.
Add glm-5.2 to models.providers.zai.models:
{
"id": "glm-5.2",
"name": "GLM-5.2",
"reasoning": true,
"input": ["text"],
"cost": {
"input": 0,
"output": 0,
"cacheRead": 0,
"cacheWrite": 0
},
"contextWindow": 1000000,
"maxTokens": 131072
}Then set the default primary model:
{
"model": {
"primary": "zai/glm-5.2",
"fallbacks": ["zai/glm-4.7"]
}
}And add the model under agents.defaults.models:
{
"models": {
"zai/glm-5.2": { "alias": "GLM" },
"zai/glm-4.7": {}
}
}Restart the OpenClaw gateway:
openclaw gateway restartThen launch OpenClaw from DevAgent or run openclaw tui in a DevAgent terminal to confirm GLM-5.2 is active.
The key rule is simple: configure GLM-5.2 wherever the harness stores provider/model settings, then let DevAgent launch that harness in the right worktree.