βοΈ Installation & Setup
Get Claude Code running on your computer in under 15 minutes β step by step, no assumptions made.
In this module
What you'll need
- A computer running Mac, Windows, or Linux
- An internet connection
- An Anthropic account (free to create at console.anthropic.com)
- ~$5β10 to add to your API account (or a Claude Pro subscription for the web option)
- About 15β30 minutes
Option A: Claude Code on the web (easiest)
If you have a Claude.ai Pro, Team, or Max subscription, you can use Claude Code directly in your browser β no installation required.
How to use Claude Code on the web
Option B: Claude Code in your terminal (recommended for power use)
The terminal version of Claude Code requires installing two things:
- Node.js β a runtime environment that Claude Code needs to run
- Claude Code itself β installed using
npm(a package manager that comes with Node.js)
ssc install or R's
install.packages() β it's a way to download and install software tools from the internet
with a single command. You won't need to understand it deeply; just use it to install Claude Code.
Installing on Mac
Step 1: Open your Terminal
Press Cmd + Space, type "Terminal", and press Enter. You'll see a window with a blinking cursor.
Step 2: Install Node.js
Go to nodejs.org, download the LTS version, and run the installer. Or, if you have Homebrew:
# If you have Homebrew (a Mac package manager)
brew install node
# Check it worked β you should see a version number like "v22.x.x"
node --version
Step 3: Install Claude Code
npm install -g @anthropic-ai/claude-code
The -g flag means "install globally" β so you can use it anywhere on your computer, not just in one folder.
Step 4: Start Claude Code
# Navigate to your project folder first
cd ~/Documents/my-research-project
# Then start Claude Code
claude
Installing on Windows
Step 1: Enable WSL
Open PowerShell as Administrator (search "PowerShell", right-click β "Run as administrator") and run:
wsl --install
Restart your computer when prompted.
Step 2: Open Ubuntu (WSL)
Search for "Ubuntu" in your Start menu. The first time you open it, set up a username and password.
Step 3: Install Node.js inside WSL
# Install Node.js version manager (nvm)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
# Reload your shell settings
source ~/.bashrc
# Install the latest LTS version of Node.js
nvm install --lts
# Check it worked
node --version
Step 4: Install Claude Code
npm install -g @anthropic-ai/claude-code
npm install -g @anthropic-ai/claude-code. WSL is just recommended for a smoother experience.
Installing on Linux
# Install Node.js (Ubuntu/Debian)
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejs
# Install Claude Code
npm install -g @anthropic-ai/claude-code
# Verify
claude --version
Connecting Claude Code to your account
Claude Code needs to connect to Anthropic's servers on your behalf. How you do that depends on whether you already have a Claude subscription.
- Claude Max plan ($100/mo) β Terminal Claude Code is included in your plan. Run
claude loginin your terminal to authenticate with your existing account via your browser. No API key, no extra billing. Skip to the cost section β - Claude Pro or Team plan ($20β25/mo) β Your subscription covers the web version only. Terminal Claude Code bills separately via the API. Continue below to set up an API key.
- No subscription yet β Continue below. You'll create a free Anthropic account and add a small credit balance.
How to get your authentication key (pay-as-you-go route)
Note: This flow is for researchers without a Max plan β either no subscription or Claude Pro. If you have Claude Max, use claude login instead β you won't see a key prompt.
When you first run claude, it will ask for your API key. Paste it in and press Enter. Claude Code stores it securely β you only need to do this once.
Understanding cost
Claude Code charges per use, measured in tokens (roughly ΒΎ of a word). You pay for what you use, like a prepaid phone plan. Your exact cost depends on which plan you're on.
| Plan / usage pattern | Terminal Claude Code cost |
|---|---|
| No subscription β light use (a few sessions/week) | ~$3β10/mo via API |
| No subscription β regular use (daily, moderate) | ~$10β40/mo via API |
| No subscription β heavy use (all-day coding) | ~$40β100+/mo via API |
| Claude Pro ($20/mo) β web version only | + separate API credits for terminal |
| Claude Max ($100/mo) | Included β no extra API charges |
Verify your installation
Run these commands to confirm everything is working:
# Check Claude Code is installed
claude --version
# Start a session (creates a test folder first)
mkdir ~/claude-test && cd ~/claude-test
claude
# Claude Code will start and show a prompt like:
>
If you see the > prompt, you're in! Type "hello" to test it. Claude should respond β and that's Claude Code running on your computer.
To exit Claude Code, type /exit or press Ctrl+C.
- "command not found: claude" β Node.js might not be installed correctly. Try closing and reopening the terminal.
- "permission denied" β On Mac/Linux, try:
sudo npm install -g @anthropic-ai/claude-code - API key not working β Make sure you added billing credits at console.anthropic.com
- Still stuck? See the official docs or post in the GitHub issues.
Module 1 Exercise: Get it running!
Complete all three steps:
- Install Claude Code using the instructions for your operating system above.
- Connect your account: if you have Claude Max, run
claude loginand authenticate via your browser. Otherwise, get your API key from console.anthropic.com and paste it when prompted. - Navigate to a folder on your computer (it can be any folder β your Desktop, or a project folder), start Claude Code, and ask it: "What files are in this folder and what do you think they're for?"
You've succeeded when Claude Code describes your files back to you. Congratulations β you have a working Claude Code setup!