name: glm5-optimizer description: Guidance for optimizing OpenClaw agents running on GLM-5 (z.ai). Use when the user wants to improve GLM-5 response quality, reduce verbose filler, prevent loop failures, or understand GLM-5 behavior. Provides best practices and optimization rules without modifying existing setup.
GLM-5 Optimizer
Guidance for optimizing any OpenClaw agent running on GLM-5 (z.ai) for better performance, reliability, and response quality.
When to Use This Skill
- User asks how to improve GLM-5 performance
- User wants to reduce verbose filler in responses
- User is experiencing loop failures (repeated tool calls)
- User wants to understand GLM-5 strengths and weaknesses
- Setting up a new agent on GLM-5
What This Skill Provides
This skill provides knowledge and guidance, not file replacement. Apply these optimizations to your existing setup:
- Optimization rules to add to your SOUL.md
- Response length guidelines
- Known GLM-5 behaviors (strengths and weaknesses)
- Prompting patterns that work best
Critical GLM-5 Optimizations
1. Loop-Breaker Rule
Add to your system prompt:
If the same tool call fails or produces the same unwanted result 3 times in a row:
1. STOP immediately
2. Try a completely different approach
3. If still stuck, ask the user for help
Why: GLM-5 can "think" about what to do but fail to translate it to tool parameters, causing infinite loops.
2. Action-Reasoning Alignment
Add to your system prompt:
Before submitting any tool call, verify:
- Thinking says "include X" → Check that X is in the parameters
- Stated intent matches actual tool call
- If thinking and action don't match, fix the action
Why: GLM-5's reasoning can disconnect from its actions.
3. Response Length Rules
Add a response length table:
| Context | Target | Max |
|---|---|---|
| Simple answers | 1-2 sentences | 50 words |
| Explanations | 2-4 sentences | 100 words |
| Complex tasks | As needed | Use structure |
Rule: If response exceeds 100 words, use bullet points or numbered lists.
Why: GLM-5 tends to over-explain by default.
4. No Filler Phrases
Add explicit prohibition:
Never say:
- "Great question!"
- "I'd be happy to help!"
- "Let me assist you with that."
- "I understand."
- "Absolutely!"
Why: GLM-5 defaults to verbose politeness markers.
5. Thinking Block Brevity
Add to your system prompt:
Keep thinking blocks focused on what to do, not detailed execution:
- Complex calculations → Use tools (exec, scripts)
- Long reasoning → Move to tool execution
- Thinking should be: goal → approach → go
Rule: If thinking exceeds 200 tokens, you're overthinking. Act instead.
Why: GLM-5 can generate 1000+ token thinking blocks.
GLM-5 Model Characteristics
Strengths
- Step-by-step reasoning
- Code generation
- Long context handling (205k tokens)
- Tool/function calling
- Multilingual (Chinese/English excellent)
Weaknesses (Addressed by This Skill)
- Reasoning-to-action disconnect (loop failures)
- Verbose filler ("I'd be happy to help!")
- Over-explanation
- Hedging ("It seems like...")
- Thinking bloat
Optimal Prompt Patterns
Pattern 1: Direct Commands
❌ "Could you please help me understand what 2+2 equals?"
✅ "What's 2+2?"
Pattern 2: Act, Don't Ask
❌ "Would you like me to read the file?"
✅ [Reads file, reports result]
Pattern 3: Structured Output
Return as:
- [format specification]
Example:
- [example output]
Pattern 4: Explicit Personality Cues
"Be casual" → More natural responses
"No filler" → Cleaner output
"Just do it" → Action over explanation
Reference Materials
references/GLM5-OPS.md— Quick reference for prompting patternsreferences/GLM5-DEEP-DIVE.md— Complete model architecture and best practicesreferences/GLM5-PERFORMANCE-REPORT.md— Real-world analysis with examples
How to Apply
- Read the reference materials to understand GLM-5
- Add the optimization rules to your existing SOUL.md
- Adjust response lengths and anti-patterns to fit your use case
- Keep the loop-breaker rule (critical for all GLM-5 agents)
- Test and iterate based on your specific needs
Validation Checklist
After applying optimizations, verify your system prompt has:
- Loop-breaker rule (3 failures → stop, try different approach)
- Action-reasoning alignment section
- Response length guidelines
- No-filler-phrases list
- Thinking block brevity rule
Based on empirical analysis of 200+ turns of real GLM-5 usage.