Content
<div align="center">
# Claude Code & GLM — Skills, Tools & Prompt Engineering
**A practical, no-fluff toolkit for getting frontier-level coding out of Claude Code — whether you run it on Anthropic's models or route it through GLM to cut your bill by 90%.**
Prompt engineering that actually moves the needle · Agent Skills that fire when you want them · MCP & tool-use patterns · Copy-paste recipes · A full prompt library.
[Getting Started](#-60-second-start) · [Prompt Engineering](01-prompt-engineering/) · [Skills](02-skills/) · [Tools & MCP](03-tools-and-mcp/) · [Workflows](04-claude-code-workflows/) · [GLM](05-glm/) · [Recipes](06-recipes/) · [Prompt Library](07-prompt-library/)



</div>
---
## Why this exists
Most "prompt engineering" content is either vague vibes or year-old screenshots. Meanwhile the actual leverage in 2026 sits in three places:
1. **The harness** — Claude Code is an agentic loop, not a chatbox. Skills, hooks, subagents, MCP, and `CLAUDE.md` change its behavior far more than clever wording ever will.
2. **The router** — Claude Code speaks a documented protocol, so you can point it at **GLM**, Kimi, or any Anthropic-compatible endpoint and keep the exact same workflow at a fraction of the cost.
3. **The craft** — Structured prompts, good examples, and tight output control still decide whether a single call succeeds or wastes a loop.
This repo is the reference I wish existed: dense, current, and copy-paste-ready. Everything here is written to be **model-portable** — the same techniques work on Claude Opus/Sonnet and on GLM-5.2 running inside the same harness.
---
## ⚡ 60-second start
**Run Claude Code on GLM** (cheap, near-frontier on short-loop coding):
1. Grab a key from [z.ai](https://z.ai) (GLM Coding Plan or pay-as-you-go).
2. Create/edit `~/.claude/settings.json`:
```json
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.z.ai/api/anthropic",
"ANTHROPIC_AUTH_TOKEN": "your_zai_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-4.7"
}
}
```
3. **Open a new terminal** (env vars only load at launch), run `claude`, and when asked *"Do you want to use this API key?"* choose **Yes**.
That's it — same CLI, different engine, ~2–5% of the per-token cost. Full guide, gotchas, and the `glm-5.2[1m]` 1M-context trick: **[Running GLM with Claude Code →](00-getting-started/running-glm-with-claude-code.md)**
> ⚠️ Two mistakes cause ~90% of failed setups: using `ANTHROPIC_API_KEY` instead of `ANTHROPIC_AUTH_TOKEN`, and editing config in an already-open terminal. See [troubleshooting](05-glm/troubleshooting.md).
---
## What's inside
| Section | What you'll learn |
|---|---|
| **[00 · Getting Started](00-getting-started/)** | What Claude Code and GLM are, install, first session, and the GLM routing setup |
| **[01 · Prompt Engineering](01-prompt-engineering/)** | Fundamentals, system prompts, XML structuring, few-shot, CoT, output control, anti-patterns |
| **[02 · Skills](02-skills/)** | Anatomy of a `SKILL.md`, writing descriptions that trigger, progressive disclosure, testing |
| **[03 · Tools & MCP](03-tools-and-mcp/)** | Tool-use mechanics, designing tool schemas, MCP servers, and when to use which |
| **[04 · Claude Code Workflows](04-claude-code-workflows/)** | `CLAUDE.md`, slash commands, subagents, hooks, headless automation, context management |
| **[05 · GLM](05-glm/)** | The model lineup, API details, GLM-vs-Claude routing, cost math, troubleshooting |
| **[06 · Recipes](06-recipes/)** | Onboarding a codebase, test gen, refactoring, code review, docs, debugging |
| **[07 · Prompt Library](07-prompt-library/)** | Ready-to-paste prompts and system-prompt templates |
| **[templates/](templates/)** | Starter `SKILL.md`, `CLAUDE.md`, and MCP server scaffolds |
---
## Who this is for
- Developers burning money on API tokens who want a cheaper backend without changing tools.
- Anyone who has pasted the same instructions into an agent for the fifth time and wants a **skill** instead.
- People who want their prompts to work the same whether the engine is Claude or GLM.
- Teams standardizing how they drive coding agents.
## The core mental model
```
┌─────────────────────────────────────────┐
│ THE HARNESS │ ← Claude Code
│ CLAUDE.md · Skills · Hooks · Subagents │ (behavior + orchestration)
└───────────────┬───────────────────────────┘
│ Anthropic-compatible protocol
┌───────────────▼───────────────┐
│ THE ENGINE │ ← Claude Opus/Sonnet OR GLM-5.2
│ (raw model calls) │ (swap freely, same harness)
└───────────────────────────────┘
```
Learn the harness once. Swap the engine per task: **GLM for volume, Claude for sustained judgment.** The [multi-model delegation guide](04-claude-code-workflows/multi-model-delegation.md) shows the routing table.
---
## Contributing
PRs welcome — fixes, new recipes, new prompts, corrections as the tools evolve. See [CONTRIBUTING.md](CONTRIBUTING.md). Everything here is a snapshot of a fast-moving space; if a config drifts, open an issue.
## License
[MIT](LICENSE) — use it, fork it, ship it.
---
<div align="center">
<sub>Built for people who ship. Star it if it saved you an afternoon. ⭐</sub>
</div>