Executive Summary
This technical handbook delivers a step-by-step Windows deployment workflow for Anthropic’s official terminal AI coding assistant Claude Code, alongside two configurable methods to replace its native Anthropic backend with DeepSeek’s LLM series. Developers in mainland China often face access barriers to Anthropic’s official global endpoints; this guide covers manual configuration file modification and streamlined switching via the CC Switch v3.16.4 desktop utility. Full environment variable mappings, file path specifications, VS Code plugin integration, and common runtime validation checks are documented with standardized technical parameters. Teams managing multi-model API traffic across coding assistants can use 4sapi to unify endpoint routing and centralize usage auditing during cross-model testing. All operational steps retain the original technical specifications while restructuring the tutorial into modular, easy-to-follow segments with formal software engineering terminology and concise, information-dense phrasing.
1 Pre-Deployment System Prerequisites
Before installing Claude Code, three mandatory runtime dependencies must be provisioned on Windows devices to eliminate installation failures:
- Node.js Runtime: Version 18 or above is required; matching npm version must be 9.x or newer to support global CLI package installation.
- Git for Windows: Mandatory for dependency resolution and CC Switch source/archive installation from GitHub repositories.
- Command Line Environment: PowerShell or standard CMD terminal with administrator permissions recommended for global npm package registration.
Core Global Installation Command
Execute this line in terminal to pull the official Claude Code CLI package from the npm registry:
Installation Validation Step
Run the version check command post-installation to confirm successful deployment:
A printed semantic version number confirms the CLI binary is registered to the system PATH; missing output indicates missing Node/Git dependencies or insufficient terminal privileges.
2 Two Deployment Routes Based On Regional Network Conditions
Anthropic’s native authentication flow relies on browser-based OAuth login, which is inaccessible for mainland Chinese developers without cross-border network support. Two distinct operational paths are defined for different user environments:
Route A: Standard Global Login (US/EU Regions Only)
For developers with direct access to Anthropic cloud services:
- Run
claude loginin terminal after successful installation - Complete account authorization via the auto-launched web browser OAuth flow
- Post-verification, the CLI loads native Claude model backends without extra configuration
Route B: Compatibility Proxy Mode (Mainland China Recommended)
This workflow bypasses Anthropic account registration entirely by redirecting all API requests to third-party compatible endpoints (DeepSeek or Zhipu GLM). Two implementation approaches are covered below: manual config editing, and automated management via CC Switch v3.16.4. This guide prioritizes DeepSeek integration as the primary third-party backend.
3 Manual DeepSeek Backend Configuration (No Third-Party Switch Tools)
This section outlines direct edits to Claude Code’s two core local configuration files, which reside under the current Windows user root directory C:\Users\[YourUsername]\. The two files serve separate functional purposes: bypassing onboarding login, and overriding API routing environment variables.
3.1 Skip OAuth Onboarding via .claude.json State File
File Path: C:\Users\[YourUsername]\.claude.json
This JSON file stores the application’s first-run initialization state; adding a boolean flag disables the automatic browser login pop-up on every CLI launch. Insert the single key-value pair into the file:
Without this parameter, Claude Code will continuously trigger unfunctional OAuth browser redirects for Chinese users.
3.2 Override API Endpoints via settings.json Global Config Folder
File Directory: C:\Users\[YourUsername]\.claude\
Create a new settings.json file inside this hidden directory to inject DeepSeek’s Anthropic-compatible API base URL, authentication token mapping, and fixed model identifiers. The complete standardized configuration payload is as follows:
Key variable definitions:
deepseek-v4-pro[1m]: High-performance reasoning model with native 1M token context window, mapped to Claude’s Opus/Sonnet high-complexity agent tasksdeepseek-v4-flash: Low-latency lightweight model assigned to minor sub-agent auxiliary logicANTHROPIC_AUTH_TOKEN: Placeholder for the API credential generated from DeepSeek’s official developer platform portal
4 Retrieve Valid DeepSeek API Credentials
- Navigate to the official DeepSeek developer open platform
- Complete account registration and identity verification
- Access the API key management console to generate a unique secret token
- Securely store the generated key for insertion into either manual
settings.jsonor CC Switch provider configuration panels
All API traffic to DeepSeek’s Anthropic-compatible gateway uses this token for request authentication; invalid keys will trigger permanent 401 unauthorized errors during Claude Code runtime.
5 Automated Model Switching with CC Switch v3.16.4
Manual JSON edits become cumbersome when rotating between multiple LLM vendors; the open-source CC Switch desktop utility centralizes all API provider management with a graphical UI. This section covers full installation and DeepSeek provider setup.
5.1 CC Switch Installation Steps
- Locate the official GitHub release page for CC Switch v3.16.4
- Download the Windows platform installation archive from the published release assets
- Execute the installer binary and complete default desktop application setup
5.2 Add DeepSeek as a New API Provider in CC Switch
- Launch CC Switch and select
Claudeas the target AI coding tool from the top navigation panel - Click the
+ Add Providerbutton to open a new vendor configuration form - Populate the required fields with DeepSeek standardized parameters:
- Provider Label: DeepSeek
- API Authentication Key: The saved secret token from DeepSeek’s developer console
- Model Mapping Rules: Assign
deepseek-v4-profor high-complexity primary agent workloads,deepseek-v4-flashfor lightweight auxiliary tasks
- Run the built-in connection test utility within CC Switch to validate endpoint handshake; a successful test confirms valid credential and routing configuration
- Save the provider profile and activate it as the active backend for Claude Code
6 Launch & Core Terminal Commands for Configured Claude Code
After finishing either manual or CC Switch-based DeepSeek routing setup, open a fresh terminal session and execute the launch command:
Successful initialization is marked by the printed welcome banner Welcome to Claude Code with no automatic browser OAuth pop-up triggered.
Essential Interactive CLI Instructions
| Command | Functional Purpose | Recommended Use Case |
|---|---|---|
/clear | Purge full conversation context token history | Start independent new development tasks to cut token consumption |
/compact | Run built-in context compression algorithm | Long multi-file refactoring workflows exceeding 500K tokens |
/help | Render full list of supported CLI subcommands | Reference unfamiliar runtime operations |
exit | Terminate the Claude Code interactive session | End daily coding assistant usage |
Cross-Platform Shortcut for Line Breaks
- Windows Terminal:
Alt + Enterto insert new lines within prompt input blocks - MacOS Terminal:
Opt + Enterequivalent binding
7 VS Code Claude Code Plugin Integration
The terminal CLI can be paired with the official VS Code extension for in-editor AI code assistance, with the same DeepSeek backend routing inherited automatically:
- Install the official Claude Code extension from the VS Code marketplace
- Open the extension sidebar panel and submit a validation prompt such as
What large language model are you currently running on? - A successful deployment will return a response referencing the assigned DeepSeek V4 series model variant, confirming the backend redirection works within the IDE environment
8 Key Technical Notes & Troubleshooting Reference
- Configuration file priority: Entries in
.claude/settings.jsonoverride temporary PowerShell environment variables; CC Switch writes persistent values directly into this JSON file on activation - Model mapping logic: DeepSeek’s 1M context
v4-provariant replaces all high-reasoning Claude base models (Opus/Sonnet), while the flash lightweight variant handles low-complexity auxiliary agent operations - Authentication error resolution: 401 response codes indicate invalid or expired DeepSeek API keys; regenerate credentials on the developer platform and refresh configuration files/CC Switch provider settings
- Missing welcome banner: Confirm the
hasCompletedOnboardingflag exists in the root.claude.jsonstate file and terminal sessions are fully restarted post config edits
Conclusion
Claude Code’s flexibility to accept third-party Anthropic-compatible API gateways eliminates regional access restrictions for Chinese engineering teams, with two robust configuration workflows provided to route all coding assistant traffic to DeepSeek’s V4 model series. Manual JSON file modification offers a lightweight, no-dependency solution for minimal environments, while CC Switch v3.16.4 delivers a graphical control plane for teams rotating between multiple LLM vendors. After completing the outlined installation and routing steps, developers gain access to full terminal and VS Code integrated AI coding functionality powered by DeepSeek’s long-context models. Centralized traffic orchestration via platforms like 4sapi simplifies parallel performance testing across native Anthropic endpoints and domestic LLM gateways, allowing teams to quantify latency and cost differences during workflow migration planning. The standardized environment variable mapping and persistent configuration file architecture ensure stable, repeatable deployments across all Windows development hardware.




