Featured image of post Install Claude Code in 5 Minutes and Connect DeepSeek

Install Claude Code in 5 Minutes and Connect DeepSeek

Overview

Claude Code is a command-line AI programming assistant launched by Anthropic, with a variety of built-in Skills plugins. Through different combinations, it can accomplish many things that AI alone cannot do. After connecting to the domestic large model DeepSeek V4, usage costs can be significantly reduced.

Core uses:

  • Building a personal knowledge base, automating the organization of study notes
  • Collecting industry information on schedule and organizing it into manuscripts
  • Automatically publishing to various social media platforms

Step 1: Install the Runtime Environment

1.1 Install Node.js

Go to the Node.js official website to download the Windows installer (.msi), double-click and follow the prompts.

Verify installation:

1
2
node -v
npm -v

1.2 Configure npm Domestic Mirror

1
npm config set registry https://registry.npmmirror.com/
💡 Why configure a mirror?

The default npm source is overseas, and download speeds are very slow. After configuring a domestic mirror, installation speed can be improved by more than 10 times.

1.3 Install Git

Go to the Git official website to download the corresponding version installer and follow the prompts.

Verify installation:

1
git -v

1.4 Install CC-Switch

CC-Switch is used to connect third-party models to Claude Code.

Go to the GitHub Release page to download the corresponding version (e.g., Windows MSI), double-click to install, and follow the prompts.

Step 2: Install Claude Code

1
npm install -g @anthropic-ai/claude-code

Verify:

1
claude --version

Skip Login (Using Third-party API)

  1. Launch Claude Code once and then close it
  2. Find the .claude.json file in your user directory
  3. Add the following field (note that a comma must be added at the end of the previous field):
1
"hasCompletedOnboarding": true
  1. Re-execute claude to start, and choose to trust the current folder
⚠️ Common Error

If you forget to add a comma at the end of the previous field, it will cause a JSON parsing error and Claude Code will fail to start.

Step 3: Connect DeepSeek

3.1 Get API Key

  1. Open DeepSeek Open Platform, register and log in
  2. Ensure your account has a balance
  3. Click API Keys on the right → Create API Key → Copy and save (cannot be viewed again after closing)
🚨 Key Security

Do not share your key with others, as it will consume your balance.

3.2 Configure CC-Switch

  1. Open CC-Switch, click the + button in the upper right corner
  2. Select DeepSeek as the model preset
  3. Enter the API Key
  4. Change the model name uniformly to: deepseek-v4-pro[1m] (context 1M, Claude Code uses 128K by default)
  5. Click Add

3.3 Verify the Model

In the Claude Code dialog box, enter:

1
/model

You can view the currently available models, or directly ask “What model are you currently using” to confirm successful connection.

Step 4: Hands-on Example

  1. Create a new folder on the desktop
  2. Enter CMD in the address bar and press Enter
  3. Execute claude to start, and choose to trust the current folder
  4. Enter your requirement: Use HTML + JS + CSS to create a Todo app
  5. During execution, it will request tool permissions — select Yes
  6. After completion, ask it to open the page for preview
💡 Tip

You can describe your requirements directly in Chinese — Claude Code supports mixed Chinese and English input.

Command Quick Reference

Operation Command
Node version check node -v
npm version check npm -v
npm domestic mirror npm config set registry https://registry.npmmirror.com/
Git version check git -v
Install Claude Code npm install -g @anthropic-ai/claude-code
Claude Code version check claude --version
Launch Claude Code claude
Switch model /model

FAQ

Command not found after running claude?

Check if Node.js is installed successfully (node -v) and whether the npm global path is in the system PATH.

Prompts to log in to Anthropic account after starting?

The hasCompletedOnboarding in .claude.json is not configured correctly. Please go back to Step 2 to check.

Model call error / no response?

Check if your DeepSeek account balance is sufficient, and whether the API Key in CC-Switch is entered correctly.

comments powered by Disqus