Table of Contents
What this lesson is about
Before Claude Code can do anything for you, it needs to be installed and running on your machine. This lesson covers the full setup process from zero to your first working session. By the end, you will have had your first real conversation with Claude Code — not in a browser, but directly on your machine.
First — what exactly is Claude Code?
You probably already know Claude as the AI you chat with at claude.ai. Claude Code is the same AI, but instead of using it through a website, you use it directly on your computer — through something called a terminal.
Think of it this way: the website version of Claude is like ordering food at a restaurant. Claude Code is like having a chef living in your house. The chef has access to your kitchen, your ingredients, your fridge. They can actually do things — not just answer questions about doing things. That is the difference. Claude Code can open files on your computer, write new ones, run programs, and connect to your tools. The website version cannot do any of that.
What is a terminal?
A terminal is a text-based window on your computer where you type instructions directly. Instead of clicking buttons, you type commands. It looks plain and old-fashioned, but it is extremely powerful.
On a Mac, the terminal app is called Terminal. Find it by pressing Command + Space and typing “Terminal”. On Windows, it is called PowerShell. Press the Windows key, type “PowerShell”, and open it. Once it is open, you will see a blinking cursor waiting for you to type.
What is npm — and why do we need it?
npm is an app store for developer tools. It is free, it comes pre-installed with Node.js, and it is how we install Claude Code. When you install an app on your phone, the App Store handles the download and installation. npm does the same thing, but for tools you use in the terminal. You only need one npm command to install Claude Code.
Steps
Step 1: Check if Node.js is installed
Open your terminal and type exactly this, then press Enter:
node --version
If you see something like v20.11.0 — you are good. Any number starting with 18 or higher will work. If you see “command not found”, go to nodejs.org, download the version marked “LTS”, and install it. Then come back to this lesson.
Step 2: Install Claude Code
Type this into your terminal and press Enter:
npm install -g @anthropic-ai/claude-code
Breaking this down: npm install means use the app store to install something. -g means install it globally so you can use it from anywhere. @anthropic-ai/claude-code is the name of what we are installing. You will see text scrolling for 30–60 seconds. Wait until it stops.
Step 3: Confirm it worked
Type this and press Enter:
claude --version
You should see a version number. That means Claude Code is installed and ready. If you see “command not found”, jump to the Common Problems section below.
Step 4: Have your first conversation
Type claude and press Enter. Claude Code will open. You will see a prompt waiting for you to type. Type something simple like “What can you help me with?” and press Enter. Claude will respond right there in the terminal. To end the session, type /exit and press Enter.
Step 5: Explore the help menu
Type this and press Enter:
claude --help
This shows every option available in Claude Code. Scan through it so you know it exists — you will not understand all of it yet, and that is fine.
Practical Exercise
- Open your terminal
- Run
node --version— write down the number you see - Run
npm install -g @anthropic-ai/claude-code— wait for it to finish - Run
claude --version— confirm a number appears - Run
claude— type “Hello, what can you do?” and read the response - Type
/exitto close the session - Run
claude --help— find one flag you are curious about and write it down
Common problems and how to fix them
“command not found” after installing — Your terminal does not know where Claude Code was installed. Install a tool called nvm (Node Version Manager), reinstall Node.js through it, and then reinstall Claude Code.
Permission denied during install — Do not use sudo npm install. Use nvm instead as described above.
Installation hangs — Check your internet connection. A firewall may be blocking the download. Try a different network.
What you have learned in this lesson
- Claude Code is Claude running directly on your computer — not through a website
- The terminal is a text window where you type instructions
- npm is how we install Claude Code — one command does everything
- There are two modes: interactive (conversation) and automated (covered later)
- The
--helpflag shows everything the tool can do