[Docs] Claude Code 2.1.154+ sends GLM models a reduced system prompt by default — please add CLAUDE_CODE_SIMPLE_SYSTEM_PROMPT=0 to your docs and coding-helper
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 22
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
Summary
Claude Code has two system prompts: full and lean (short). Since v2.1.154 (released 2026-05-28), the lean prompt is the default for all non-Claude model IDs. So every GLM model ID — glm-5.3, glm-5.3-flash, and their [1m] variants — gets the short prompt. The short prompt removes many instructions that teach the model how to work as a coding agent.
Result: GLM looks much weaker inside Claude Code than it really is. One environment variable fixes this. It is missing from your docs and from @z_ai/coding-helper.
How to verify (5 minutes)
- Install Claude Code >= 2.1.154 and connect it to GLM as described in your docs: https://docs.z.ai/devpack/tool/claude
- Run
claudein any folder. Type/context. Note the "System prompt" size: about 1.7k tokens. This is the lean prompt. - Add this key inside the
"env"block of~/.claude/settings.json. If the file already exists (the coding helper creates it), do not replace the file — only add this one key:
"CLAUDE_CODE_SIMPLE_SYSTEM_PROMPT": "0"
Example of a full file:
{
"env": {
"ANTHROPIC_AUTH_TOKEN": "YOUR_ZAI_KEY",
"ANTHROPIC_BASE_URL": "https://api.z.ai/api/anthropic",
"CLAUDE_CODE_SIMPLE_SYSTEM_PROMPT": "0"
}
}
- Restart
claude. Run/contextagain: about 7k tokens. This is the full prompt. - Optional exact proof: dump raw API requests with
OTEL_LOG_RAW_API_BODIES=file:/tmp/ccdumpand compare thesystemfield between the two runs.
Measurements
Three live runs, clean config (no user MCP servers), empty folder, Claude Code 2.1.251, model glm-5.3-flash. Verified with raw request dumps (OTEL_LOG_RAW_API_BODIES), 2026-08-31.
| Layer | Full (=0) | Lean (default) | Change |
|---|---|---|---|
| System prompt | 27,833 chars | 6,446 chars | -77% |
| All tool descriptions | 52,638 chars | 34,589 chars | -34% |
| Bash tool description | 9,813 chars | 1,265 chars | -87% |
| WebSearch tool description | 1,319 chars | 309 chars | -77% |
| Agent tool description | 6,926 chars | 1,668 chars | -76% |
| WebFetch tool description | 1,503 chars | 374 chars | -75% |
| Edit tool description | 1,094 chars | 360 chars | -67% |
| Read tool description | 1,830 chars | 838 chars | -54% |
| Write tool description | 618 chars | 240 chars | -61% |
The "Lean" column is measured with your recommended CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 in effect — the lean prompt and the tool descriptions are the same with and without it.
Another team measured the same thing independently (Sonnet 4.6, Claude Code 2.1.220, different setup): system prompt 28,464 vs 6,966 chars, 24 tools in both runs. See CherryHQ/cherry-studio#18028. The results are consistent.
What GLM loses in lean mode
- The "Doing tasks" section: the engineering discipline rules (prefer editing existing files, no abstractions beyond what the task requires, no half-finished work, test UI changes in a browser, and more).
- Prompt injection detection for tool results (WebFetch / MCP / web content). Completely absent in lean mode (verified in the dumps: 3 mentions in the full prompt, 0 in the lean prompt).
- Rules for parallel tool calls (reduced from a detailed section to a single line).
- Delegation guidance from the system prompt — when to use subagents and the Explore agent (the shortened Agent tool description keeps only the bare core).
- Most of the Bash tool description: git workflow, PR creation steps, background task handling (-87% of characters).
Anthropic wrote in the v2.1.154 release notes: "The lean system prompt is now the default for all models except Haiku, Sonnet, and Opus 4.7 and earlier."
This works for their newest Claude models. For GLM the result is different: in everyday use, the same GLM model follows instructions much better with the full prompt — fewer mistakes and fewer repeated steps. Repeated steps also consume Coding Plan points faster.
Why the settings in your docs do not fix this
Your docs recommend CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1. This disables server-side experiments, but not the lean prompt. We verified this directly: with this variable set to 1 and a clean environment, Claude Code still sends the lean prompt (system prompt 6,446 chars, Bash description 1,265 chars — the same lean prompt as without the variable). The lean prompt for non-Claude model IDs is not an experiment — the CLI applies it unconditionally. Only CLAUDE_CODE_SIMPLE_SYSTEM_PROMPT=0 restores the full prompt.
This is an official, documented option. From https://code.claude.com/docs/en/env-vars: "Set to 0, false, no, or off to opt out even on models where the experiment or server configuration would otherwise enable it. The full tool set, hooks, MCP servers, and CLAUDE.md discovery remain enabled."
Request
Please add "CLAUDE_CODE_SIMPLE_SYSTEM_PROMPT": "0" to:
- the env block in https://docs.z.ai/devpack/tool/claude
- the settings.json written by @z_ai/coding-helper
One line, officially supported by Claude Code, and it restores full agent quality for all GLM Coding Plan users.
References
- Release notes v2.1.154 (published 2026-05-28): https://github.com/anthropics/claude-code/releases/tag/v2.1.154
- Official env vars docs: https://code.claude.com/docs/en/env-vars
- Independent comparison and security note: https://github.com/CherryHQ/cherry-studio/pull/18028
- Related docs issue in the Claude Code repo (closed without action): https://github.com/anthropics/claude-code/issues/63291
- Related report about system prompt importance in ZCode: #78
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Claude Code documentation page at docs.z.ai/devpack/tool/claude and inspect the settings.json generation in @z_ai/coding-helper. Add CLAUDE_CODE_SIMPLE_SYSTEM_PROMPT set to 0 in both env blocks, preserving existing settings, then verify that the documented configuration and generated settings.json contain the key.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- json
- Domain
- developer-experience, documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 82/100