Lesson 2: Installing Claude Code
Fast-track: Already have Claude Code installed? Run
claudein your terminal. If it launches and you can log in, skip to Lesson 3.
What is Claude Code?
Claude Code is an AI agent that lives in your terminal. Think of it as a senior developer sitting next to you โ it can read your files, write code, run commands, and build entire projects. The difference is you talk to it in plain English.
It's not a chatbot. It's not autocomplete. It's an agent that can take action on your behalf.
Install Claude Code
The simplest way to install Claude Code is using the official installer. Open your terminal, paste the command for your operating system, and press Enter.
On Mac/Linux
Run curl -fsSL https://claude.ai/install.sh | sh in your terminal:
curl -fsSL https://claude.ai/install.sh | sh
On Windows
Run irm https://claude.ai/install.ps1 | iex in PowerShell:
irm https://claude.ai/install.ps1 | iex
Good instinct to ask. Commands that download and run scripts (curl ... | sh) should always make you pause and check the source. In this case, the URL is claude.ai โ Anthropic's official domain โ so it's safe. But as a general rule: always verify the URL before running commands like this. If a random forum tells you to curl [some url] | bash, look up what that URL is before running it.
After running the installer
You'll see progress text scrolling. Wait for it to finish โ it should say "Claude Code successfully installed!" at the end.
If it tells you to add something to your PATH, follow those instructions (it will give you the exact command to copy and paste). Then close your terminal and reopen it so the changes take effect.
I'm trying to install Claude Code using the installer command from claude.ai but I'm getting an error. I'm using [Mac/Windows/Linux]. The error message is: [paste your error here]. Can you help me figure out what went wrong?
If the installer above doesn't work and you already have Node.js installed, you can also install with npm by running npm install -g @anthropic-ai/claude-code in your terminal.
If you get EACCES or "permission denied" on Mac, don't use sudo to force it โ that can cause problems later. Instead, fix the permissions first by running sudo chown -R $(whoami) ~/.npm, then try the npm install command again.
On Windows, close your terminal and reopen it as Administrator, then try again.
If the install succeeded but claude gives you "command not found" or "'claude' is not recognized":
- Close and reopen your terminal. Same reason as Lesson 1 โ the terminal needs to restart to see newly installed programs.
- Still not working? The installer may have printed a line asking you to add something to your PATH. Run that command, then close and reopen your terminal.
I installed Claude Code but when I type "claude" I get "command not found." I'm on [Mac/Windows/Linux]. Can you help me add Claude Code to my PATH?
First launch
Type claude and press Enter:
claude
That's it. One word. You'll see a welcome message with version info, then Claude Code will walk you through a few setup steps.
You have Claude Code
You just installed an AI agent on your computer. From here on out, you have a senior developer sitting next to you โ ready to help you build anything. Let's finish the setup.
Login flow
Claude Code needs to know who you are. Here's what happens:
- It will ask you to log in
- Your browser will open automatically with an authorization page
- Click "Authorize" in the browser
- Switch back to your terminal โ it should now say you're logged in
If your browser doesn't open, copy the URL it shows you and paste it into your browser manually.
I'm trying to log in to Claude Code in my terminal. I ran the "claude" command but the login isn't working. Here's what's happening: [describe the issue - browser not opening, authorization failing, stuck on loading, etc.]. Can you help me troubleshoot this?
You need a Claude account on the Pro plan ($20/month) or higher. If you don't have one yet, sign up at claude.ai and upgrade to Pro. Claude Code is included with Pro โ no separate purchase needed.
Log in with whatever method you used to create your Claude account (Google, email, etc.).
Theme selection
Claude Code will ask you to choose a visual theme โ this controls the colors in your terminal. Pick whatever looks good to you. It takes two seconds and you can change it later.
"Trust this folder"
The first time you run Claude Code in a folder, it will ask: "Do you trust this folder?"
Say yes.
This is a security prompt. Claude Code can read and modify files in whatever folder you're in. It's asking: "Are you sure you want me to have access here?" Since you're going to be building a project in this folder, the answer is yes.
This prompt will appear once per new folder. It's Claude Code being careful with your files โ which is a good thing.
Checkpoint
You're ready for the next lesson if:
-
claudelaunches without errors - You're logged in (no login prompts)
- You've selected a theme
- You've accepted the "trust this folder" prompt