Claude Code Tutorial: Complete Guide to Installation, Configuration & Model Selection for Chinese Users

Claude Code installation guide with affordable model alternatives for developers in China.
Claude Code is Anthropic's autonomous AI coding agent that reads entire projects and auto-generates/debugs code, unlike traditional chat-based AI coding. This article compares it with Copilot, Cursor, and Trae, then provides three alternative model solutions for Chinese users since Anthropic blocks mainland China: DeepSeek V4 Pro (best value), Tongyi Qianwen subscription plans, and Sonnet proxy APIs, along with practical cost control tips.
What is Claude Code? How Does It Differ from Traditional AI Coding?
Claude Code is an AI programming assistant developed by Anthropic. It works in a fundamentally different way from the typical "chat-to-code" approach you'd use on DeepSeek or ChatGPT's web interface.
The traditional workflow looks like this: you describe your requirements in a chat window, the AI gives you a code snippet, you copy it into your project and run it, hit an error, go back to ask again, and repeat this cycle several times before getting it to work. Even worse, these conversational AIs can't see other files in your project — if your project has 100 code files, it can't read a single one of them. You have to manually describe all the context yourself.
Claude Code takes a completely different approach:
- It can read through all files in your project, feeding the complete context to the large language model
- It automatically generates business logic code based on your requirements
- When errors occur, it automatically debugs and troubleshoots until it produces a working version
- It truly achieves the "describe requirements → automatically deliver code" development workflow
In simple terms, traditional AI coding makes "you the courier," while Claude Code makes "AI the programmer." Behind this difference is a fundamental shift in the AI programming paradigm — from "code completion" to "autonomous coding agent." An autonomous coding agent doesn't just generate code; it has a complete capability loop that includes reading the file system, executing terminal commands, analyzing execution results, and iteratively fixing issues. It essentially simulates a real programmer's workflow.

Horizontal Comparison of Mainstream AI Programming Assistants
Before Claude Code, there were already quite a few AI programming tools on the market. Let me walk through the pros and cons of each to help you make your choice.
Copilot
First previewed in 2021 and commercially launched in 2022, this is a code completion plugin developed jointly by GitHub and OpenAI. It was originally built on OpenAI's Codex model (a code-fine-tuned version of GPT-3). It works by predicting code snippets the developer might type next based on the current file's context in real time — think of it as "autocomplete for code." It was genuinely revolutionary for developers at the time, but its positioning leans more toward "smart completion" rather than fully automated coding. The limitation of this completion mode is that it can only see the currently open file and a small number of adjacent files, unable to understand the entire project's architecture and dependencies like Claude Code can. GitHub later launched Copilot Chat and Copilot Workspace, gradually evolving toward fully automated coding, but overall maturity is still catching up.
Cursor
Cursor goes further than Copilot by supporting automated coding, with overall capabilities comparable to Claude Code. However, Claude Code still has the edge in code accuracy. Cursor is a paid product, suitable for teams with sufficient budget. Cursor's advantage is that it's a complete IDE in itself (deeply customized based on VS Code), with AI capabilities directly embedded in the editor, making it easier to pick up for developers who prefer graphical interfaces.
Trae (Domestic/International Version)
Trae has excellent Chinese language understanding, and the domestic version being free is its biggest selling point. However, if you're using a niche tech stack, the quality of generated code drops noticeably. The international version requires payment.
OpenCode
Also an AI programming tool, but in actual use, the experience is among the worst of all tools — high learning curve, not recommended for beginners.
Codex
Made by OpenAI, reportedly capable of matching Claude Code when paired with GPT-5 — genuinely a formidable tool. It's worth noting that this Codex refers to OpenAI's 2025 coding agent product, which shares the name with the earlier Codex model used to train Copilot but has a completely different positioning — the new Codex is an AI agent that can autonomously execute code tasks in a cloud sandbox environment.
My conclusion: The capabilities of all AI programming assistants ultimately depend on the quality of the underlying large language model. The Sonnet model behind Claude Code is extremely powerful at code generation, and after comprehensive testing, it's the most intuitive AI programming tool I've used to date.
Detailed Claude Code Installation Steps
One thing to clarify upfront: Claude Code is not an IDE (Integrated Development Environment) — it's different from Cursor or Trae. Claude Code is a standalone command-line tool (CLI) that, once installed locally, can be integrated as a plugin into your preferred development environment.
The choice of CLI over IDE form factor has deep reasoning behind it: traditional IDEs integrate code editing, debugging, and version control in a graphical interface, while CLI tools interact through terminal commands and naturally possess stronger automation and scripting capabilities. Claude Code's CLI form means it can directly invoke system commands, execute shell scripts, and manipulate the file system — all essential low-level capabilities for AI autonomous programming. Meanwhile, the plugin-based integration approach means developers don't need to switch their existing development environment, reducing migration costs.
Supported development environments for integration include:
- VS Code
- Cursor
- Trae
- IntelliJ IDEA
- PyCharm

System Requirements
| Item | Requirement |
|---|---|
| Operating System | macOS, Windows, Linux all supported |
| Memory | 4GB or more |
| Network | VPN required during installation |
| Additional Dependencies | Windows requires Git pre-installed |
Installation Commands
macOS users:
# Execute the corresponding installation command in Terminal
Windows users (PowerShell):
# Execute the installation command in PowerShell
The entire installation process takes about 3-5 minutes. If you see a large amount of red error messages on screen, it's almost certainly because your VPN isn't active and the network connection failed. After successful installation, Claude Code will auto-update via Git (e.g., automatically upgrading from 2.1.97 to 2.1.116).
Tip: After installation, if you're using a domestic model (like DeepSeek), you can skip the VPN during daily use — much more convenient.
First Use
# First cd to your project directory, then type
claude
On first launch, it will ask you to select and trust a project directory. After confirming, you can start conversational programming. Just describe your requirements in natural language, and Claude Code will automatically read project files, generate code, and debug.
Model Selection & Configuration: How Chinese Users Can Get Started
This is the part domestic developers care about most. Claude Code defaults to guiding you to log in with an official Anthropic account, but this path is basically a dead end for users in China.
Why Official Anthropic Accounts Aren't Recommended
Anthropic does not offer services to mainland China and Hong Kong. Even if you manage to register with a foreign phone number, using it from China will most likely result in account suspension. So don't waste money buying Anthropic accounts.

For reference, Anthropic officially offers three model tiers:
| Model | Characteristics | Context Window | Input Price (per million tokens) | Output Price (per million tokens) |
|---|---|---|---|---|
| Opus | Most capable, ideal for complex business logic, slower | 1M | $5 | $25 |
| Sonnet | Balanced, fast with deep reasoning | 1M | $3 | $15 |
| Haiku | Entry-level, high cost-effectiveness | 200K | Lower | Lower |
Here's an explanation of Tokens and Context Windows, as they directly determine your usage costs. A token is the basic unit of text processing for large language models — one Chinese character is typically split into 1-2 tokens, while one English word is approximately 1-1.5 tokens. The context window refers to the maximum number of tokens a model can process in a single conversation. A 1M (1 million) context window means the model can "read" approximately 500,000 Chinese characters at once — crucial for understanding large code projects. Claude Code passes project files as context to the model with every conversation, so the larger the context window, the larger the project it can handle, but the higher the token consumption — which is exactly why cost control matters so much.
Three Alternative Solutions Available in China
Since official accounts aren't accessible, we can configure other models' APIs within Claude Code. Here are three solutions I've personally tested.
Option 1: DeepSeek V4 Pro (Currently Most Recommended)
DeepSeek V4 Pro is currently running a 75% off promotion — only ¥6 per million output tokens, ¥3 for input, with 1M context window support.
I actually used it to build two medium-complexity projects, spending only about ¥12 total, with each conversation costing just a few cents. This cost-effectiveness is the highest among all options.
⚠️ Note: The discount expires at the end of this month, after which the price may rise to ¥24 per million tokens. If you want to save money, top up early.
Option 2: Tongyi Qianwen Coder (Pay-per-use NOT Recommended)
Here's a real case: I had ¥37 in my account balance, and it was completely drained after just two conversations. The price is about ¥24 per million tokens — painfully expensive to use.
If you do want to use Tongyi Qianwen, I recommend purchasing the Coding Plan subscription (¥200/month), which gives you 6,000 calls per 5-hour window. When the quota is used up, it automatically resets — much more cost-effective than pay-per-use.

Option 3: Sonnet Proxy API
Use the Sonnet model through a third-party proxy service's API Key. API proxying means third-party service providers deploy proxy servers overseas to forward API requests from domestic users to Anthropic's official endpoints. Proxy providers typically hold official API Keys and resell at a markup after obtaining price advantages through bulk purchasing.
Technically, proxy services add an extra network hop, so response latency is slightly higher than direct connections, and there's a privacy risk of data passing through third-party servers. When choosing a proxy service, pay attention to the provider's stability, data privacy policies, and whether they support streaming output — streaming lets the code generation process display in real time rather than waiting for completion, providing an experience closer to a direct connection.
Performance is slightly lower than official direct connections, but pricing is reasonable — about ¥1-2 per conversation, with simple questions potentially costing just a few cents. You can find proxy Keys on Taobao; just choose stores with high sales volume and good reviews. This option is suitable for users who want to experience the original Sonnet model but don't have an official account.
Cost Control & Usage Tips
Tools like Claude Code are inherently heavy token consumers because every conversation requires reading the project context. Here are some tips to effectively control costs:
- Prioritize DeepSeek V4 Pro — Use it heavily during the discount period; cost-effectiveness crushes other options
- Choose subscription plans over pay-per-use whenever possible — The Tongyi Qianwen case already demonstrated the pay-per-use pitfall
- Control project context scope — Use a
.claudeignorefile to exclude directories that don't need AI reading (likenode_modules, log files, etc.), which can significantly reduce token consumption..claudeignoreworks similarly to Git's.gitignorefile: when Claude Code scans the project directory, it reads the rules defined within and skips matching files and directories. This not only reduces token consumption but also prevents AI from being distracted by irrelevant files (such as build artifacts, dependency packages, log files), thereby improving code generation accuracy. Typical exclusions includenode_modules,dist,build,.logfiles, binary files, etc. With proper configuration, token consumption per conversation for large projects can be reduced by over 50% - Use cheaper models for simple questions, reserve premium models for complex logic — You don't need Opus to rename a variable
Summary: Now Is the Best Time to Get Started with Claude Code
The reason Claude Code has become one of the strongest AI programming assistants today comes down to two core strengths: code generation accuracy and deep understanding of project context. Although Anthropic's official accounts are unfriendly to Chinese users, domestic developers can use it smoothly by configuring DeepSeek V4 Pro or using Sonnet proxy APIs.
Right now happens to coincide with DeepSeek V4 Pro's discount period, bringing usage costs down to nearly negligible levels. If you've been on the fence about AI programming tools, I recommend installing and configuring it now — get this tool up and running before the discount ends.
After all, wouldn't it be better to spend the time that AI saves you on writing code and debugging on something more valuable?
Related articles
TutorialsChatGPT Plus Subscription Guide: Are GPT-5.5, image-2, and Codex Worth the Upgrade?
A detailed look at ChatGPT Plus features — GPT-5.5, image-2, and Codex — with a Plus vs Pro comparison and a complete step-by-step subscription guide for users outside the US.
TutorialsHarness AI Engineering in Practice: Using Claude Code to Master Enterprise-Level E-Commerce Development
Deep dive into Harness AI Engineering: master enterprise e-commerce development with Claude Code using the Rules, Skills, Wiki, and Changes framework.
TutorialsCursor + Codex Dual-IDE Collaboration: A Practical Methodology for Open-Source Project Customization
A complete methodology for open-source project customization based on real-world experience, detailing the Cursor+Codex dual-IDE workflow, seven-stage process, MVP validation, and AI source code reading techniques.