Install Claude Code and start a session

Step-by-step: install Claude Code on Mac, Windows or Linux, log in, open a project folder and run your first agentic coding session with confidence.

Lesson 1.3โฑ 8 min read๐ŸŒฑ Curiousโ“ 3-question quiz
The short answer

Install Claude Code with the official installer script or npm, then type claude inside a project folder and log in with your Claude account or an Anthropic Console API key. Start by asking it to explain the project before asking it to change anything.

Step 1: open a terminal

  • Mac: press Cmd + Space, type Terminal, press Enter.
  • Windows: open PowerShell or install WSL (Windows Subsystem for Linux) for the smoothest experience.
  • Linux: you already know where your terminal is. ๐Ÿ˜‰
Analogy: the terminal is like texting your computer instead of clicking around. Each line you type is an instruction.

Step 2: install Claude Code

The recommended route is Anthropic's native installer:

curl -fsSL https://claude.ai/install.sh | bash

Alternatively, if you already have Node.js (version 22 or newer) installed, you can use npm, the Node package manager:

npm install -g @anthropic-ai/claude-code

Check it worked:

claude --version
Tip: always check the official Claude Code docs for the latest install command for your operating system, as installers evolve over time.

Step 3: open a project and log in

Claude Code works on whatever folder you start it in. Make a practice folder and launch it:

mkdir my-first-project
cd my-first-project
claude

The first time, it will ask you to log in. You can use a Claude subscription account or an API key from the Anthropic Console (pay-as-you-go). Follow the prompts in your browser, then come back to the terminal.

Step 4: your first conversation

Try these in order:

  1. Create a simple index.html page that says hello, with a nice gradient background
  2. Claude will propose creating a file and ask permission. Read it, then approve.
  3. Explain what you just made, line by line, like I'm new to HTML
  4. Open the file in your browser to see the result.

Useful basics while you're in a session:

  • /help: lists available commands
  • Esc: interrupt Claude if it heads the wrong way
  • /exit or Ctrl + C twice: leave the session
Golden rule for existing projects: ask Claude to explain the codebase first ("give me an overview of this project") before you ask it to change anything.

Check yourself

Three quick questions to check it stuck.

Ask the tutor

Stuck on something in this lesson? Ask the AI tutor. It answers from this lesson and points you to others that help. Answers are written by AI and can be wrong. Do not include personal details, passwords or company secrets.

Frequently asked

How do I install Claude Code on Windows?

Use the official installer for Windows from the Claude Code docs, or install WSL (Windows Subsystem for Linux) and run the Linux install command inside it. Then type claude in your project folder.

Do I need Node.js to use Claude Code?

Only if you install via npm, which requires Node.js 22 or newer. The native installer does not need you to install Node.js yourself.

How do I start Claude Code in a project?

Open a terminal, move into the project folder with cd, and type claude. Claude Code works on the folder you launch it from.