How to Install and Configure Claude Code with ZCF for Seamless AI Coding
This guide walks you through installing Node.js, using the zero‑configuration ZCF tool to set up Claude Code and its router, configuring OpenRouter API keys and default models, handling common errors, and quickly launching Claude Code in the terminal or VSCode.
Background
Claude Code is a limited command‑line AI Code Agent with rich Agent/MCP/Hooks features. Official Claude APIs often get blocked for Chinese IPs, so a persistent solution using a proxy while preserving Claude’s native model is required.
Installation Steps
Install Node.js (Node 22.x+ LTS). Verify the installation with node -v, npm -v, and npx -v.
Install ZCF , a zero‑configuration tool for Claude Code & Codex. Run npx zcf, accept the prompts, and choose Simplified Chinese.
Configure Claude Code Router (CCR) – select OpenRouter, enter the API key, choose a default model such as anthropic/claude‑sonnet‑4.5, and enable required MCP services (Context7, Spec, Playwright, etc.).
Full Installation (Method 1)
Run the ZCF wizard to install Claude Code, CCR, and optional CCometixLine, then save and restart CCR. The configuration is stored in ~/.claude-code-router/config.json (or C:\Users\heiye\.claude-code-router\config.json on Windows).
Partial Configuration (Method 2)
If Claude Code and CCR are already installed, choose the R option in the ZCF menu to edit the CCR configuration directly, or modify the config.json file manually and restart the service.
Error Handling
Most errors arise from an incorrect api_key. Edit the config.json file, update the key, and restart CCR using zcf or ccr restart. If problems persist, verify your network proxy or VPN settings.
Quick Usage
Start Claude Code with ccr code. Use built‑in agents, list installed tools, and run workflows such as planner or spec. For VSCode integration, add the following environment variables to settings.json:
"claude-code.environmentVariables": [
{"name": "ANTHROPIC_BASE_URL", "value": "http://127.0.0.1:3456"},
{"name": "ANTHROPIC_API_KEY", "value": "sk‑zcf‑x‑ccr"},
{"name": "DISABLE_TELEMETRY", "value": "1"},
{"name": "DISABLE_ERROR_REPORTING", "value": "1"},
{"name": "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC", "value": "1"},
{"name": "MCP_TIMEOUT", "value": "60000"}
]After saving, the VSCode extension works without additional prompts.
Nightwalker Tech
[Nightwalker Tech] is the tech sharing channel of "Nightwalker", focusing on AI and large model technologies, internet architecture design, high‑performance networking, and server‑side development (Golang, Python, Rust, PHP, C/C++).
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
