TimeMachineLab

Claude Code China Guide — Development skill for Claude Code

Development community

Claude Code / Codex 国内使用教程:安装、接入中转站与 DeepSeek/Kimi/GLM 配置、报错排查、API 检测脚本.

How to install Claude Code China Guide

This entry records only its repository, not the path inside it, so there is no exact command to give. Open TimeMachineLab/claude-code-china-guide and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Claude Code China Guide does

Claude Code / Codex 国内使用教程:安装、接入中转站与 DeepSeek/Kimi/GLM 配置、报错排查、API 检测脚本.

Alternatives in Development

  • Claude Code Config Switcher — Switch between multiple Claude Code providers (Kimi, GLM, MiniMax, etc.) with a single command 85 ★
  • Siftlight — Context-efficient project search and bounded code analysis for Claude Code & Codex & Pi & OMP & kimi ....and r 82 ★
  • SpecFusion — 在 DeepSeek Harness / Claude Code / Cursor / Codex / Gemini CLI 里直接搜索 20 个中国开放平台的 65,600+ 篇 API 文档;零配置,支持 Skill 66 ★

README

Claude Code / Codex 国内使用教程(2026)

**中文** | [English](README.en.md)

**一份面向国内开发者的 Claude Code 和 Codex 上手指南:安装、选择 API 来源、接入中转站或 DeepSeek / Kimi / GLM、排查报错。每一步都有可以直接复制的配置文件。**

在国内用 Claude Code 和 Codex,最常卡在这几步:官方账号注册不了、没有海外信用卡、接口连不上、`settings.json` 写错、模型 ID 对不上。本仓库按「安装 → 选来源 → 配置 → 验证 → 排错」的顺序讲清楚,并附一个**一行命令检测 API 是否接通**的脚本。

由 [Orbis(orbiorbi.com)](https://orbiorbi.com/?utm_source=github&utm_medium=readme&utm_campaign=claude-code-china-guide&utm_content=intro) 团队维护。文中同时给出 DeepSeek、Kimi、GLM 官方接口的配置,方法适用于任何兼容服务。 最后核对:**2026-10-23**。配置过时了?欢迎提 [Issue](../../issues) 或 PR。

目录

30 秒看懂:国内用 Claude Code 的三条路

Claude Code 是 Anthropic 出的命令行 AI 编程工具,Codex 是 OpenAI 出的同类工具。两者都允许**自定义 API 地址**,所以除了官方账号,还可以接其他兼容服务:

方式 能用的模型 付款 国内直连 适合谁
① Anthropic / OpenAI 官方 Claude / GPT 海外信用卡 ❌ 身在官方支持地区、有海外支付方式的人
② 国产模型官方的 Anthropic 兼容接口 DeepSeek、Kimi、GLM 各自的模型 人民币 ✅ 只用一家国产模型
③ 多模型聚合平台(中转站) Claude、GPT、Gemini、国产模型都有 人民币 视平台而定 想用一个 Key 切换多家模型

⚠️ Anthropic 官方的[服务地区](https://www.anthropic.com/supported-countries)不含中国大陆。通过第三方平台调用 Claude 模型前,请自行评估服务条款与合规风险;只用国产模型的话,② 是最省心的选择。

第 1 步:安装 Claude Code 和 Codex

**Claude Code**(官方推荐原生安装,会自动更新):

# macOS / Linux / WSL
curl -fsSL https://claude.ai/install.sh | bash
# Windows PowerShell
irm https://claude.ai/install.ps1 | iex

也可以用 npm 安装(需要 Node.js 22+):`npm install -g @anthropic-ai/claude-code`。装完开一个新终端,运行 `claude --version` 能打印版本号就成功了。

如果 `claude.ai` 的安装脚本下载不了,用 npm 加国内镜像:`npm install -g @anthropic-ai/claude-code --registry=https