Using Claude Code in China (2026): CC Switch + DeepSeek Setup Guide
If you want to use the latest AI coding tool smoothly and cheaply from China, the least painful route is to connect a model you can reach directly from China. This guide explains how to use the open-source tool CC Switch to connect DeepSeek and other domestic models to Claude Code and Codex with one click — no VPN required.
📚 Table of Contents (click to jump)
- What Is CC Switch? Solving the Model-Switching Pain
- Download and Quick Install
- Prepare a Model API Key (DeepSeek as the Example)
- Hands-On: Connect Claude Code
- Pros and Cons
- Who It's For
- FAQ
- Final Thoughts
What Is CC Switch? Solving the Model-Switching Pain
Before you start, it's worth being clear about why you need this.
Command-line AI coding tools like Claude Code and Codex each use a different underlying configuration format. If you want to point them at a model provider you can reach from China, you normally have to dig through documentation and hand-edit JSON, TOML, or .env files — get one Base URL or API Key wrong and the tool simply stops working.
CC Switch is an open-source, cross-platform desktop tool built specifically for that pain point. It can:
- Provide a visual interface that manages the configuration of Claude Code, Codex, the Gemini CLI, and other AI coding tools in one place
- Ship 50+ built-in presets for domestic and international model providers (including DeepSeek, Qwen, Kimi, Zhipu GLM, and MiniMax)
- Switch providers from the system tray with one click and no manual code editing, enabling VPN-free use of AI coding tools in China


Source code: https://github.com/farion1231/cc-switch
Download and Quick Install
For stability and the newest features, download from the official channels:
Per-platform install guide:

- Windows: download the
.msiinstaller and click through the wizard - Linux: pick the
.deb,.rpm, or.AppImagethat matches your distribution - macOS: download the
.dmgand drag it to install
Once installed, launch CC Switch — the main window stays on your desktop or in the system tray, ready when you need it.
Prepare a Model API Key (DeepSeek as the Example)
Connecting a cost-effective domestic model is the key step. DeepSeek is the example here:

- Visit the DeepSeek open platform and sign up
- Navigate to the API keys page and click Create new API Key
- Important: the generated Key is shown in full only once at creation — copy it on the spot and store it somewhere safe
Hands-On: Connect Claude Code
Claude Code is Anthropic's native terminal AI coding assistant, able to analyze a project, write code, run commands, and fix bugs on its own. But the native tool requires signing in with an overseas account — CC Switch is how you work around that.
1. Install Claude Code Locally
Make sure Node.js is installed (if not, download it from the official Node site). Open a terminal and run:
npm install -g @anthropic-ai/claude-code2. Take Over the Model Configuration with CC Switch
Normally, typing claude in the terminal gets stuck at the login step. Let CC Switch take over instead:

- Open CC Switch, select Claude in the top app bar, and click Add provider

- Search the preset list for DeepSeek and select it

- Paste the DeepSeek API Key you saved earlier

- Parameter notes: CC Switch includes
DeepSeek-V4-Pro(suited to coding and complex reasoning) andDeepSeek-V4-Flash. If you need to work with a very large codebase, tick Enable 1M mode (a million-token ultra-long context)

- Click Add in the bottom-right to save; the interface shows you the JSON configuration it changed for you

- Finally, click to enable the DeepSeek model

Reopen your terminal, type claude, and send a test question: "What model are you?" If the AI correctly replies that it's DeepSeek, the connection worked.
💡 If you hit repeated reconnecting or WebSocket errors after connecting — especially behind a proxy — see the dedicated troubleshooting guide; it takes about two minutes to fix.
💡 Already have a Codex membership and don't want to pay separately for API credits? If you're subscribed to ChatGPT / Codex, you can convert the Codex membership into a local API Key with an open-source tool and paste it into CC Switch: see the CLIProxyAPI guide: turning a Codex membership into a local API for Claude Code.
Pros and Cons
Advantages of connecting DeepSeek through CC Switch
- No VPN: domestic models connect directly, with no overseas account or network environment needed
- Visual: pick a provider and you're done — no hand-editing JSON / TOML / .env, and the wrong-Base-URL trap is gone
- Reversible: it doesn't damage your existing configuration, so you can switch back to the official Claude models at any time
Limitations / things to note
- Depends on a third-party API: you need to register with DeepSeek or similar and fund an API Key
- It swaps the provider rather than running native Claude: some official features, such as web search, behave differently
- Behind a proxy you may see WebSocket reconnect errors that need extra troubleshooting
Who It's For
- Developers in China without an overseas account who still want to use Claude Code or Codex
- Developers who don't want to hand-edit config files and prefer a point-and-click setup
- Anyone who wants low-cost access to DeepSeek and other models while balancing speed and value
FAQ
Q: How do I use Claude Code in China without a VPN? A: Use the open-source tool CC Switch to connect Claude Code to DeepSeek or another domestic model. Native Claude Code requires an overseas account; CC Switch replaces the model provider with an API reachable from China through a visual interface.
Q: Which domestic models does CC Switch support? A: Built-in presets cover DeepSeek, Qwen, Kimi, Zhipu GLM, MiniMax, and 50+ other providers, and you can add your own. DeepSeek V4-Pro is recommended for coding and complex reasoning, and the 1M ultra-long-context mode is available for very large projects.
Q: Can I switch back to the official Claude models afterward? A: Yes. CC Switch is a configuration-switching tool that doesn't damage your existing setup — you can move between providers and models with one click at any time, with no reinstall.
Q: What if I keep getting Reconnecting or errors after connecting? A: It's usually a WebSocket connection issue behind a proxy. See the dedicated troubleshooting guide in the related reading below — one config change resolves it.
Final Thoughts
The blocker for using Claude Code in China isn't that the tool is hard — it's that it defaults to requiring an overseas account. CC Switch turns "swap the model provider" from hand-editing configuration into a visual click, and DeepSeek is cheap enough and capable enough. Together they're the least painful VPN-free option available.
Once you have a working Claude Code, if you also use Codex you can connect DeepSeek to it exactly the same way.
