Module 1 Β· Beginner Β· ~30 min

βš™οΈ Installation & Setup

Get Claude Code running on your computer in under 15 minutes β€” step by step, no assumptions made.

😌
Don't panic about the terminal The terminal (also called the command line or shell) sounds intimidating, but we'll walk through every step. If you've ever typed a command in Stata or R's console, you already understand the core concept. It's just another place to type instructions.

What you'll need

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

🌐
Go to claude.ai
Log in with your account
πŸ“
Open Projects
Click "Projects" in the left sidebar
βž•
New Project
Create a project for your research
πŸ“€
Upload files
Add your data, code, notes
πŸ’¬
Start chatting
Ask Claude to help with your project
⚠️
Web vs. Terminal: key difference The web version is great for getting started, but the terminal version is more powerful β€” it can directly read and write files on your computer without you uploading them, run code, and integrate with your whole project folder automatically. Most power users prefer the terminal. This course covers both. Start with whichever feels comfortable.

Option B: Claude Code in your terminal (recommended for power use)

The terminal version of Claude Code requires installing two things:

  1. Node.js β€” a runtime environment that Claude Code needs to run
  2. Claude Code itself β€” installed using npm (a package manager that comes with Node.js)
πŸ“–
Jargon check: What is npm? npm stands for "Node Package Manager". Think of it like Stata's 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

πŸ’‘
Recommended: Use WSL (Windows Subsystem for Linux) Claude Code works best on Windows through WSL β€” a built-in Windows feature that gives you a Linux environment. It's easier than it sounds. Follow these steps:

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
πŸ’‘
Alternative: Native Windows (without WSL) Claude Code does work on Windows natively. Download Node.js from nodejs.org, install it, then open Command Prompt or PowerShell and run 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.

πŸ’³
Already have a Claude subscription? Check which path applies to you:
  • Claude Max plan ($100/mo) β€” Terminal Claude Code is included in your plan. Run claude login in 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)

🌐
Visit
console.anthropic.com
πŸ‘€
Create account
Sign up (free)
πŸ’³
Add credit
$5 minimum to start
πŸ”‘
Create API key
Under "API Keys" section
πŸ“‹
Copy key
Starts with sk-ant-...

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.

πŸ”’
Keep your API key secret! Your API key is like a password with a credit card attached. Never share it, never paste it into a document or email, never commit it to GitHub. If you accidentally expose it, go to console.anthropic.com immediately and delete it, then create a new one.

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 patternTerminal 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
⚠️
Pro plan β‰  free terminal access A Claude Pro subscription ($20/month) covers the web interface at claude.ai β€” it does not include terminal Claude Code. If you use the terminal on a Pro plan, API usage is billed separately on top of your subscription. Only the Max plan bundles terminal Claude Code at a flat rate.
πŸ’°
Tip for staying within budget (API users) Set a spending limit at console.anthropic.com β†’ "Billing" β†’ "Usage limits". Start with $10 and increase as you learn. Most researchers find $15–30/month covers daily use comfortably.

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.

πŸ› οΈ
Troubleshooting: common issues
  • "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:

  1. Install Claude Code using the instructions for your operating system above.
  2. Connect your account: if you have Claude Max, run claude login and authenticate via your browser. Otherwise, get your API key from console.anthropic.com and paste it when prompted.
  3. 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!

Terminal ~15 min