Harvard Data Science Initiative Harvard Faculty of Arts and Sciences

Generative AI for Scholarship

Harvard Data Science Initiative (HDSI) & Faculty of Arts and Sciences (FAS)
API Key for This Session
The key will be posted shortly before the session and will work until midnight on the day of the session.
Retrieve API Key (Harvard Key required)

Week 3 — Claude Code CLI Setup for Windows

Friday, March 6, 2026 · 4:00–5:30 pm · Northwest Building, Room B103

Important: The setup below installs an AI agent that can read, write, and execute code on your computer. While we will run it in a sandboxed mode with restricted permissions, we recommend performing a full backup of your system before proceeding.

This guide covers setting up Claude Code on Windows. If you are on a Mac, see the Mac setup guide instead.

Step 1: Install Git

Claude Code requires Git. Download and install it from:

Download Git for Windows

All default settings during installation are fine.

Step 2: Install Python

Download and install Python from:

Download Python

All default settings during installation are fine.

Step 3: Install Claude Code

Open Terminal from the Start menu (type "Terminal" and click the result). Run the following command to install Claude Code:

irm https://claude.ai/install.ps1 | iex

The installer will display a message asking you to add a directory to your PATH. Note the directory it mentions — you will need it in Step 4 below. It will typically be:

C:\Users\<USERNAME>\.local\bin

Full documentation: Claude Code installation and setup

Configure Claude Code settings

Still in the same Terminal window, create the Claude Code settings file. Replace <API_KEY> with the key you retrieved from the link at the top of this page:

notepad .claude\settings.json

Notepad may ask if you want to create a new file — click Yes. Paste the following text into the file, replacing <API_KEY> with your actual API key:

{
  "env": {
    "ANTHROPIC_MODEL": "us.anthropic.claude-sonnet-4-5-20250929-v1:0",
    "ANTHROPIC_SMALL_FAST_MODEL": "us.anthropic.claude-haiku-4-5-20251001-v1:0",
    "ANTHROPIC_BEDROCK_BASE_URL": "https://apis.huit.harvard.edu/ais-bedrock-llm/v2",
    "ANTHROPIC_API_KEY": "<API_KEY>",
    "CLAUDE_CODE_SKIP_BEDROCK_AUTH": "1",
    "CLAUDE_CODE_USE_BEDROCK": "1"
  },
  "disableLoginPrompt": true,
  "autoUpdatesChannel": "latest"
}

Save the file (Ctrl+S) and close Notepad.

Security: Never Share Your API Key

Your API key is like a password — treat it with the same level of security.

Step 4: Add Claude Code to Your PATH

Claude Code needs to be on your system PATH so Windows can find it.

  1. Open the Start menu and search for "Edit environment variables for your account"
  2. In the User variables section, select Path and click Edit
  3. Click New and add the directory the installer mentioned (typically C:\Users\<USERNAME>\.local\bin)
  4. Click OK to save, then OK again to close
Important: After changing the PATH, you must close and reopen Terminal for the change to take effect.

Step 5: Install Visual Studio Code

Download and install VS Code from:

Download Visual Studio Code

Install the Claude Code extension

  1. Open VS Code
  2. Press Ctrl+Shift+X to open the Extensions panel
  3. Search for "Claude Code"
  4. Find the extension published by Anthropic and click Install

Disable the login prompt in VS Code

Since we are using Harvard's HUIT proxy rather than Anthropic's direct authentication, you need to disable the default login prompt:

  1. Open VS Code Settings: Ctrl+comma
  2. Search for "Claude Code login"
  3. Check the box for Disable Login Prompt
  4. Close the Settings tab: Ctrl+W (settings auto-save)

Step 6: Verify Everything Works

Open a new Terminal window from the Start menu and test that Claude Code is accessible:

claude --version

You should see a version number. Then launch Claude Code:

claude

You can also open Claude Code directly inside VS Code by clicking the spark icon in the top-right corner of an editor tab, or by pressing Ctrl+Shift+P and typing "Claude Code".

Send a simple test message:

Hello, what model are you?

You should receive a response from Claude through the HUIT proxy. If it works, you're all set.

This warning is expected and safe to ignore:
Auth conflict: Using ANTHROPIC_API_KEY
 instead of Anthropic Console key. Either
  unset ANTHROPIC_API_KEY, or run `claude
  /logout`.
This just means Claude Code is using your HUIT API key (from ANTHROPIC_API_KEY) instead of a personal Anthropic account. That's exactly what we want — no action needed.

Exercises

After the Session: Get Your Own API Key

Important: The API keys provided during this session will be disabled after the course ends. To continue using Claude Code, you will need to obtain your own Anthropic API key.

For Harvard users, we have prepared detailed instructions on how to set up API access through Harvard's HUIT system:

Setting Up Anthropic API Access for Harvard Users

Post-Session Survey

Please take a moment to share your feedback — it helps us improve future sessions.

Take the Post-Session Survey