Install Claude Code
Get Claude Code running on your machine
⏱ Est. ~9 min
01 · Read
Installing Claude Code is simple — it's an npm package, just like the ones you learned about in Level 7. You install it globally so you can use it from any directory on your machine.
You need three things:
1. Node.js (you already have this from Level 7) 2. The Claude Code package (install via npm) 3. An Anthropic account (for authentication)
Let's get set up.
Key points
- Claude Code installs via npm, like any other package
- Global install (-g) makes it available everywhere
- You need an Anthropic account to authenticate
02 · Real-machine exercise
Install Claude Code globally using npm. The -g flag makes it available system-wide, not just in one project.
npm install -g @anthropic-ai/claude-code
03 · Real-machine exercise
Verify the install by checking the version. Seeing a version number means Claude Code is installed correctly.
claude --version
04 · Quiz
What does the -g flag mean when installing an npm package?
- Install the latest version
- Generate a config file
- Integrate with Git
- Install globally (available system-wide)
05 · Fill in the blank
To install Claude Code globally, type npm install _____ @anthropic-ai/claude-code.
06 · Real-machine exercise
Now let's authenticate. Run claude for the first time to launch it. It'll walk you through logging into your Anthropic account. Follow the on-screen prompts — it'll open a browser for you to sign in.
claude
07 · Quiz
You just finished installing Claude Code and running it for the first time. If you open a brand new terminal window and type claude, what happens?
- It launches Claude Code, because the -g flag made it available system-wide
- It fails, because every terminal window needs its own install
- It tells you to run npm install first
- It only works in the folder you installed it in
08 · Fill in the blank
To confirm Claude Code is installed, run claude _____ in the terminal.
Other lessons in this chapter
⚠ The full interactive experience needs JavaScript. Please enable it and reload.
※ This is an independent Traditional Chinese teaching project — not an official Anthropic product. Claude™ is a trademark of Anthropic, PBC.