From fb3a233fe3c94ea3a2e5e4efda191d3a382c5d82 Mon Sep 17 00:00:00 2001 From: uroma Date: Thu, 15 Jan 2026 14:48:49 +0000 Subject: [PATCH] Integrate official Z.AI GLM Claude Code documentation - Add Claude Code installation prerequisite (npm install) - Update GLM configuration with official model mappings (glm-4.5-air, glm-4.7) - Add version verification (recommended 2.0.14+) - Include troubleshooting steps from Z.AI docs - Add /status command verification - Reference official Z.AI documentation: https://docs.z.ai/devpack/tool/claude - Update README with proper GLM model configuration --- MASTER-PROMPT.md | 76 +++++++++++++++++++++++++++++++++++++++++++----- README.md | 37 ++++++++++++++++------- 2 files changed, 96 insertions(+), 17 deletions(-) diff --git a/MASTER-PROMPT.md b/MASTER-PROMPT.md index 94cd55c..02a3927 100644 --- a/MASTER-PROMPT.md +++ b/MASTER-PROMPT.md @@ -11,6 +11,25 @@ ``` I want to install the Ultimate Claude Code & GLM Customization Suite with 40+ agents, MCP tools, and auto-triggering automation. Please perform the following integration: +## Prerequisites: Install Claude Code + +**Before installing agents and tools, ensure Claude Code is installed:** + +```bash +# Install Claude Code (requires Node.js 18+) +npm install -g @anthropic-ai/claude-code + +# Verify installation (recommended: 2.0.14+) +claude --version + +# If needed, upgrade to latest +claude update +``` + +**Reference:** https://docs.anthropic.com/en/docs/claude-code/overview + +--- + ## Step 1: Install Contains Studio Agents (37 agents with PROACTIVELY auto-triggering) Clone the contains-studio/agents repository: @@ -50,26 +69,69 @@ This provides 15+ MCP tools including: ## Step 3: Configure Model (Choose ONE) -Option A: Anthropic Claude (Official API) -Visit: https://console.anthropic.com/ -Create ~/.claude/settings.json with: +### Option A: Anthropic Claude (Official API) + +**Best for:** Production, highest quality, official support + +1. Get your API key: https://console.anthropic.com/ +2. Create ~/.claude/settings.json: +```json { "env": { "ANTHROPIC_AUTH_TOKEN": "sk-ant-your-actual-api-key-here", "ANTHROPIC_BASE_URL": "https://api.anthropic.com" } } +``` +3. Verify installation: `claude --version` -Option B: Z.AI / GLM Coding Plan (90% cheaper) -Visit: https://z.ai/ -Create ~/.claude/settings.json with: +### Option B: Z.AI / GLM Coding Plan (90% cheaper, Official Integration) + +**Best for:** Development, testing, cost-sensitive projects + +**Follow official Z.AI documentation:** https://docs.z.ai/devpack/tool/claude + +1. **Get your GLM Coding Plan API key:** + - Visit: https://z.ai/ + - Sign up for GLM Coding Plan + - Copy your API key + +2. **Configure Claude Code for GLM:** + Create ~/.claude/settings.json with: +```json { "env": { "ANTHROPIC_AUTH_TOKEN": "your-zai-api-key-here", "ANTHROPIC_BASE_URL": "https://api.z.ai/api/anthropic", - "API_TIMEOUT_MS": "3000000" + "API_TIMEOUT_MS": "3000000", + "ANTHROPIC_DEFAULT_HAIKU_MODEL": "glm-4.5-air", + "ANTHROPIC_DEFAULT_SONNET_MODEL": "glm-4.7", + "ANTHROPIC_DEFAULT_OPUS_MODEL": "glm-4.7" } } +``` + +3. **Verify and test:** +```bash +# Check Claude Code version (recommended: 2.0.14+) +claude --version + +# Start Claude Code +claude + +# Check model status (enter /status when prompted) +/status +``` + +4. **Troubleshooting (if configuration doesn't take effect):** + - Close all Claude Code windows + - Open new terminal and run `claude` again + - Or delete ~/.claude/settings.json and reconfigure + - Verify JSON format is correct (no missing/extra commas) + +**GLM Models Available:** +- `glm-4.5-air` - Fast, efficient (Haiku equivalent) +- `glm-4.7` - High quality (Sonnet/Opus equivalent) ## Step 4: Configure Hooks-Based Auto-Triggering (Optional) diff --git a/README.md b/README.md index fc204f5..9c87408 100644 --- a/README.md +++ b/README.md @@ -130,6 +130,8 @@ echo "Hello, Claude!" | claude **Best for:** Development, testing, cost savings (up to 90% cheaper) +**Official Documentation:** https://docs.z.ai/devpack/tool/claude + #### 1.1 Get Your API Key ```bash @@ -137,7 +139,7 @@ echo "Hello, Claude!" | claude # Create an account and get your GLM Coding Plan API key ``` -#### 1.2 Configure Claude Code +#### 1.2 Configure Claude Code for GLM ```bash # Create/update your Claude Code settings @@ -147,30 +149,45 @@ cat > ~/.claude/settings.json << 'EOF' "env": { "ANTHROPIC_AUTH_TOKEN": "your-zai-api-key-here", "ANTHROPIC_BASE_URL": "https://api.z.ai/api/anthropic", - "API_TIMEOUT_MS": "3000000" + "API_TIMEOUT_MS": "3000000", + "ANTHROPIC_DEFAULT_HAIKU_MODEL": "glm-4.5-air", + "ANTHROPIC_DEFAULT_SONNET_MODEL": "glm-4.7", + "ANTHROPIC_DEFAULT_OPUS_MODEL": "glm-4.7" } } EOF ``` -#### 1.3 Install Claude Code +**GLM Models Available:** +- `glm-4.5-air` - Fast, efficient (Haiku equivalent) +- `glm-4.7` - High quality (Sonnet/Opus equivalent) + +#### 1.3 Install Claude Code (if not installed) ```bash -# Install Claude Code +# Install Claude Code (requires Node.js 18+) npm install -g @anthropic-ai/claude-code -# Or use curl -curl -fsSL https://claude.ai/install.sh | sh +# Verify version (recommended: 2.0.14+) +claude --version + +# Upgrade if needed +claude update ``` #### 1.4 Verify Installation ```bash -# Test Claude Code with Z.AI -claude --version +# Start Claude Code +claude -# Test connection -echo "Test connection" | claude +# Check model status (enter /status when prompted) +/status + +# Troubleshooting: +# - Close all Claude Code windows and reopen +# - Or delete ~/.claude/settings.json and reconfigure +# - Verify JSON format is correct ``` ---