A Step-by-Step Guide to Using Claude Code with GLM Coding Plan
Learn how to install, configure, and use Claude Code with the GLM Coding Plan, including model switching tips, effort adjustment, and solutions to...
Claude Code is an intelligent coding tool that operates in the terminal, enabling developers to interact via natural language commands to quickly complete tasks like code generation, debugging, and refactoring. This guide provides a comprehensive walkthrough on setting up and using Claude Code with the GLM Coding Plan, along with key configuration steps and troubleshooting solutions.
Step 1: Install Claude Code
Prerequisites include Node.js 18 or later. macOS users should use nvm or Homebrew for Node.js installation to avoid permission issues, while Windows users need Git for Windows. Install Claude Code via: npm install -g @anthropic-ai/claude-code. Verify installation with claude --version—a version number confirms success. Note: Do not launch Claude Code immediately; complete configuration first to avoid network/region restrictions.
Step 2: Configure GLM Coding Plan
1. Register Account: Visit the Zhipu Open Platform and finish registration.
2. Get API Key: Personal plan users find keys in Personal Programming Plan > Plan Overview; team members use Team Programming Plan > My Plan (team keys are non-interchangeable). Keep keys secure and avoid hardcoding.
3. Set Environment Variables: Choose from automation helper (run npx @z_ai/coding-helper), script, or manual setup. Restart the terminal to apply changes.
Step 3: Start Using Claude Code
Navigate to your code directory and run claude. Select Yes when prompted about the API key, then grant folder access. You’re ready to use Claude Code for development.
Common Issues & Tips
Model Switching: Default mappings link Claude models to GLM-4.7. To use GLM-5.2 with 1M context, edit ~/.claude/settings.json to add variables like ANTHROPIC_DEFAULT_OPUS_MODEL: "glm-5.2[1m]" and CLAUDE_CODE_AUTO_COMPACT_WINDOW: "1000000". Upgrade Claude Code if the model isn’t recognized.
Effort Adjustment: Use /effort command. Mappings to GLM-5.2: low/medium/high → high; xhigh/max/ultracode → max (recommended for complex tasks).
Visual & Search MCP: Refer to Visual MCP Server, Search MCP Server, and Webpage Reading MCP Server docs for setup.
Manual Config Not Working: Close all Claude windows, restart terminal, or delete ~/.claude/settings.json and reconfigure. Validate JSON format with an online tool.
Recommended Version
Use the latest version. Check with claude --version and upgrade via claude update. Versions like 2.1.140 are verified to work.
Sources
- Zhipu Big Model Documentation: https://docs.bigmodel.cn/cn/guide/develop/claude