@Khazix0918: https://x.com/Khazix0918/status/2046082879109959807
Summary
This article is a beginner's guide to installing and using Claude Code for Chinese users, covering installation methods for both Mac and Windows (including setups without a VPN), as well as how to integrate domestic models (such as GLM-5.1) as alternatives to Claude's native models.
View Cached Full Text
Cached at: 05/09/26, 05:07 AM
The Ultimate Beginner’s Guide to Using Claude Code in China — From Scratch
Recently, a lot of friends have been asking me to put together a beginner’s tutorial for Claude Code.
They want to use what is arguably the most powerful Agent product in the world.
And honestly, a lot of people don’t realize this: Agent products are generally made up of an Agent framework plus a model. Claude’s models are indeed blocked in China — that’s extremely difficult to deal with, and I have no way to help you with that.
But Claude Code itself won’t get blocked and won’t stop working, because it’s essentially just an Agent framework that can be paired with any model.
Yes, Anthropic is pretty ruthless — constantly banning accounts, rolling out real-name verification — but I still have to admit that Claude Code is currently the best Agent framework in the world.
So I’ve always said: if you can go straight to the best option, do it. I know tools like OpenClaw and Hermes Agent are trending right now, but I’ll still recommend Claude Code. Even if you can’t access Claude’s native models, pairing it with a domestic Chinese model still delivers excellent results.
And you don’t need to worry about account bans, a foreign phone number, a Visa card, or even a VPN.
So today, here’s a comprehensive beginner’s guide to Claude Code from scratch — and I’ve done my best to make it accessible to everyone. I’ve prepared instructions for both Windows and Mac, with and without a VPN. Just read the section that applies to you.
The installation process below was something I spent an entire weekend working out with my team, going through five or six computers installing and uninstalling over and over again.
For example, in some scenarios — like without a VPN — there are other installation methods, like npm or curling from a domestic mirror. Those can work, but they weren’t stable enough across different machines in my testing.
So in the end, I went with what I consider the simplest approach — one that holds up even on a completely bare-bones machine.
I hope everyone can follow along and successfully get the world’s most powerful Agent framework up and running.
I’ll try to explain every step in as much detail as possible — it might get a bit verbose, but bear with me.
Alright, let’s get started.
Part I: Installing Claude Code
1. Mac
Let’s start with Mac. Windows users can skip ahead to the Windows section.
First, find and open Terminal in your Applications.
Now let’s install our star of the show: Claude Code.
I’ve created a brand-new macOS account on my machine — essentially a clean slate — to make this easier to demonstrate.
First, let’s cover the case where you have a VPN.
It’s just one command:
curl -fsSL https://claude.ai/install.sh | bash
Paste this into Terminal and press Enter.
Wait a moment, and you should see a success message.
It’ll be installed, but there may be a prompt telling you something like: Claude Code is installed, but its location ~/.local/bin hasn’t been added to your PATH environment variable, so running claude directly might not work.
It’ll also tell you to run a certain echo command to fix this.
Don’t worry if you don’t understand it — just do what it says. Copy that long echo command into Terminal and press Enter.
Then type claude --version. If a version number appears, the installation was successful.
With a VPN, it’s really that simple. But I know many of you don’t have one.
So if you don’t have a VPN, you can install Claude Code via Homebrew.
Homebrew is the most popular command-line package manager for macOS. It lets you install, update, and uninstall all kinds of software and dev tools with a single command.
I’m borrowing a brand-new laptop from one of my colleagues — no VPN, completely clean environment.
Let’s first install Homebrew. It might look a bit intimidating, but if you just follow along, it’s actually very simple.
Paste the following command into Terminal and press Enter:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
When prompted, just press Enter.
It’ll start running.
Wait a few minutes. When you see the success message, Homebrew is installed.
Next, we need to add Homebrew to our PATH so that Terminal can find its commands.
Paste these few lines into Terminal and run them.
Now you can use Homebrew to manage Mac packages.
Then, use the following command to install Claude Code. Note: because the WeChat article editor auto-reformats certain characters, copying and pasting directly may cause errors. Please type this one out manually, or paste it into an AI chat to have it cleaned up before running it in Terminal:
brew install --cask claude-code@latest
Installation might be a bit slow — feel free to go make a coffee and come back.
Once you see the success message, type claude in Terminal and you should see the little crab logo.
At this point, it might show an error saying it can’t connect — that’s fine for now. We’ll hook it up to a model in the next section.
That covers Mac. Now let’s talk about Windows — it’s slightly different. Mac users who are already set up can skip this section.
2. Windows
Now for Windows.
I ran through this on a freshly reinstalled Windows machine.
Because Claude Code internally uses Git Bash to execute commands on Windows, you need to have Git installed first.
Step 1: Install Git.
If you already have Git installed, skip this part.
We’ll use WinGet — Windows’ official package manager, essentially the Windows version of Homebrew.
Search for “Terminal” in the taskbar and open it.
Paste the following command into Terminal. Don’t use a VPN for this — it’ll actually be faster without one:
winget install Git.Git
When it finishes, it’ll show a success message.
Now, with Git installed, let’s cover the VPN case first.
If you have a VPN, use the official native install command.
Paste into Terminal:
irm https://claude.ai/install.ps1 | iex
Wait a moment and it’ll be installed. Super easy.
If you don’t have a VPN, use WinGet to install:
winget install Anthropic.ClaudeCode
Once installed, type claude in Terminal — you should see the confirmation that it’s installed.
At this point, you’ve installed the framework — but you haven’t given it a brain yet, so it can’t actually do anything.
Let’s hook it up to a model.
Part II: Connecting a Model
If you have a Claude account, just log in — I won’t go into detail on that here.
Realistically, if you already have a Claude account, you probably don’t need this beginner’s guide anyway.
So, to make this accessible to everyone in China, I’ll walk through an example using the domestic model GLM-5.1.
GLM-5.1 is currently the domestic model that, in my experience, comes closest to the Claude Opus 4.6 experience.
If you didn’t get into their coding plan, MiniMax M2.7 and K2.5 are also solid alternatives. K2.6 Code should be out soon too, and it feels like Kimi is about to have a major leap — worth keeping an eye on.
Zhipu does provide a one-liner to set up GLM-5.1:
npx @z_ai/coding-helper
But to make it easy to connect other models and switch between them freely, I’ll show you a more universal method: CC Switch.
Again, split by Mac and Windows.
1. Mac
On Mac, installation is just two commands. Same caveat as before — the second command may have formatting issues if copied directly from this article, so type it manually or clean it up via an AI first:
brew tap farion1231/ccswitch
brew install --cask cc-switch
Paste into Terminal and press Enter.
Once it finishes, you’re good to go.
2. Windows
On Windows, I recommend downloading the installer directly from:
https://github.com/farion1231/cc-switch/releases
If you can’t access GitHub, I’ve also prepared a local installer — just reply cc to this WeChat account and the download link will be sent to you automatically.
After downloading, double-click to run it and click Next through the whole process.
The rest of the steps are the same for both Mac and Windows.
Once installed, open CC Switch.
You’ll see that it supports not just Claude Code, but also Codex, Lobster (小龙虾), and others.
Since we haven’t configured anything yet, only the official Claude model configuration is shown.
Under the Claude section, click the + button in the top-right corner to add a new model configuration.
Select the model you want to use — I’m choosing GLM (domestic version).
You only need to fill in two things: your API Key (if you don’t know what an API Key is, ask any AI — they’ll walk you through it) and the model configuration. Everything else will be auto-filled.
Once you’ve filled those in, click Add in the bottom-right corner.
CC Switch will then switch to the model you just configured.
At this point, both Claude Code installation and GLM-5.1 integration are complete.
Part III: Launching Claude Code
Go back to Terminal, type claude, and press Enter.
Claude Code will launch normally.
On first launch, there are some initial setup steps.
Color theme — there’s a code preview below each option. Pick what you like and press Enter.
You can change this later in Claude Code by running /theme.
Safety reminder — two key points:
- Claude makes mistakes. Review generated code and commands before approving them.
- Only use Claude Code in repos you trust — to avoid prompt injection attacks.
Press Enter to continue.
Terminal settings — just use the recommended settings.
This enables two things:
- A keyboard shortcut for newlines in the terminal.
- Visual bell — when Claude finishes a task or needs your input, the terminal window will flash and the Dock icon will bounce to alert you.
Final step — it asks whether you trust the current directory.
Select Yes and press Enter.
And you’re in! You’re now in the Claude Code chat interface, connected to GLM-5.1.
To switch models later, just configure them in CC Switch, then run /model inside Claude Code to switch.
That’s everything for installation and setup.
Going forward, just type claude in Terminal to launch it.
One tip: I highly recommend using the following command when working — especially during development — otherwise you’ll be clicking “Allow” so many times you’ll lose your mind:
claude --dangerously-skip-permissions
Also, because of how context is designed, you’ll want to launch Claude Code pointed at a specific folder rather than from the root directory. This keeps it focused and constrained.
I organize my own directories like this: one for writing and knowledge work, and a code folder for all the products I build.
Pointing Claude Code at a specific folder is easy — same on both Mac and Windows.
Use the cd command. For example, to enter a folder called “knowledge base”:
Open Terminal, type cd, press Space, then drag your folder into the Terminal window.
Press Enter — you’re now inside that folder.
Then launch Claude Code from there. It will default to working only within that folder and will automatically read all the files inside it.
This means less context pollution and better focus — in other words, it performs smarter.
Part IV: Writing Your CLAUDE.md
Now that you know how to launch Claude Code, you can technically start chatting and getting it to work.
But before you dive in deep, there’s one important habit I think you should establish first — don’t make the same mistakes I did. Set up your CLAUDE.md file before anything else.
In my opinion, this is the very first thing you should do after learning to launch Claude Code.
Before we get into the specifics, let me explain what CLAUDE.md actually is.
It’s not just a file — it’s a layered constraint system that cascades top-down.
Like the diagram I’ve used before:
Right after installing, the two layers you need to manage are Global CLAUDE.md and Project CLAUDE.md.
Global CLAUDE.md lives in your user home directory under Claude Code’s root: ~/.claude/CLAUDE.md
It gets loaded automatically every time you open Claude Code, no matter which project you’re in.
This is your top-level ruleset.
It handles questions like: who you are, your operating principles, and how you want Claude to collaborate with you.
Project CLAUDE.md lives in the root of each individual project: [project directory]/CLAUDE.md
It only loads when you open that specific project.
It handles the specifics: how this particular project should be approached, and any special conventions.
Let’s start with the Global CLAUDE.md — the first thing to lock in.
A lot of people aren’t sure what to put in CLAUDE.md, how to write it, how long it should be, or where to put it. For non-developers especially, here’s what I’ve learned:
Length: CLAUDE.md is not a “the longer the better” situation. Keep it concise.
If your CLAUDE.md is too long, Claude will simply ignore the latter half.
The hard limits: beyond 80 lines, Claude starts missing things. Never exceed 200 lines.
I’ve shared my own Global CLAUDE.md in a previous article. I’ve since iterated on it and put together a template for everyone.
It includes everything I think a solid Global CLAUDE.md should have.
Just fill in your own info under the “About Me” section — almost everything else can be reused as-is.
## About Me
[Your name / identity / professional background — if you're not a developer, make sure to say so].
I use Claude Code for [specific use case 1] and [specific use case 2].
## Thinking Principles
Approach every decision from first principles — don't copy patterns just because "that's how it's done."
Come back to the core question: What are we actually solving? What's the most direct path? If we were designing this from scratch, what would we do?
Don't flatter me. Don't tell me my idea is great, don't say "that's a great question," don't open with "Of course!" Give me honest assessments. If there's a problem with the approach, say so directly. If you see a better way, say it without waiting for me to ask.
## Constraints First
Whether it's a development project or a knowledge management project, the first step is always establishing rules:
- New project → write CLAUDE.md first.
- New directory → define structure conventions first (what goes where, naming conventions, when to clean up).
Don't start work without a ruleset.
For existing projects, strictly follow the conventions in their CLAUDE.md.
If conventions need updating, revise the documentation first, then the practice — never the other way around.
## Communication Style
- Default to Chinese; use English for code, commands, and variable names.
- Lead with the conclusion, then the reasoning — don't open with background.
- When requirements are ambiguous, give the most reasonable approach, then ask if adjustments are needed.
- Don't ask "Are you sure you want to do this?" unless it hits a red line below.
## Autonomy Boundaries (Red Lines — Must Ask Me First)
Even in auto-accept mode, stop and ask me before:
- Deleting files, directories, or git history
- Modifying .env files, keys, tokens, or CI/CD configuration
- Database schema changes or data migrations
- `git push`, `git rebase`, `git reset --hard`, or force pushes
- Installing new global dependencies or modifying system configuration
- Public releases (npm publish, deploying to production, publishing articles, etc.)
## General Engineering Discipline
- After making changes, proactively run validation (see each project's CLAUDE.md for specific commands) — don't just change things without verifying.
- Don't comment out errors or add workaround flags just to make code run — find the root cause.
- Keys, tokens, and passwords don't go in code, commits, or logs.
- Before major changes, use Plan Mode to draft a plan; wait for my confirmation before proceeding.
Just over 30 lines, organized into six sections.
All six have one thing in common: they’re universal across projects.
Once your Global CLAUDE.md is set, your top-level ruleset is in place.
For the next layer down — Project CLAUDE.md — let me use my own setup as an example.
I mainly use Claude Code for development and knowledge management.
For instance, under my code/my directory, I have a CLAUDE.md. The purpose: everything I code in that folder tends to be throwaway stuff — experiments, quick hacks, random small things. I genuinely can’t be bothered to create a new subfolder every time.
So my workflow now is to cd into the my folder, launch Claude Code, and just tell it what I need. With a CLAUDE.md in place, Claude will automatically determine whether it’s a new project, and if so, create a new subfolder and get started. File management stays organized on its own.
And you don’t need to write that project CLAUDE.md yourself — just open the folder, start chatting with Claude Code, describe your needs and preferences, and have it write one for you.
I’ve been doing this myself lately — working with Claude Code to define proper conventions and cleaning up the legacy messes I’ve accumulated.
If your machine is a clean slate right now, even better — this is exactly why I’ve always emphasized constraints first, conventions first.
Once the constraints are set, you’re truly ready to start playing.
As for skills, plugins, common commands, and features — I won’t get into those here. I’ve written about them extensively in other articles; just search the relevant keywords if you’re interested.
Final Thoughts
I finally finished this beginner’s guide to Claude Code that I’d been putting off for way too long.
Claude Code is what I’d call the graduation tool for the current AI era.
You don’t need to mess around with all the various Agents out there. Master Claude Code, and you’ll truly understand what it means to have the most powerful Agent at your fingertips.
I hope everyone has a great time building.
Go create something.
Something that belongs to you.
Something that belongs to this era.
Similar Articles
@jakevin7: Scrolling Linux DO I saw a post—turns out Claude Desktop can use a custom API. I always thought it couldn’t, and even the AIs I asked said no. Checked the official docs and it’s actually in there, just buried deep. Steps: 1. Install but don’t log in (tiny gotcha: menu won’t click, so mouse into the email box, Tab to the menu, hit Enter) 2. Help → Troubleshooting → Enable Developer Mode 3.
Claude Desktop supports custom APIs via Developer Mode; the option is documented but well hidden.
@howlemont: The most useful takeaway from this arXiv paper, "Dive into Claude Code," is how clearly it explains that once a system like Claude Code enters a real-world environment, the engineering focus immediately shifts to very practical concerns. Of course, Claude Code is a coding agent; it runs...
This article analyzes the arXiv paper "Dive into Claude Code," discussing the key engineering implementation aspects of coding Agent systems like Claude Code in real-world environments, including capabilities such as shell execution, file modification, and external service invocation.
@yaohui12138: I've finished reading it. Here are some key takeaways I've compiled for everyone: In this session, he primarily broke down a core mechanism overlooked by 90% of users: the CLAUDE.md context injection system. This system is divided into three levels: Enterprise-level: Organization-wide mandatory rules that cannot be overridden by individual settings. Project-level: Team-shared code standards and workflows. Loc...
The article shares key insights from a workshop by Boris on using CLAUDE.md for context injection in Claude, highlighting three usage levels, specific commands like /loop, and plan mode to improve developer workflows.
@Michaelzsguo: https://x.com/Michaelzsguo/status/2053217839729791221
This article is a guide for local large model deployment, covering hardware selection, memory calculations, Runtime tool comparisons, and model quantization options, helping users from getting started to optimizing their local inference experience.
Full Claude Code Tutorial for Non-Technical Beginners in 2026 (step-by-step)
A comprehensive step-by-step tutorial for non-technical users to learn how to use Claude Code, covering setup, pricing, and building projects like a 3D game without writing code.