Friday, March 6, 2026 · 4:00–5:30 pm · Northwest Building, Room B103
This session focuses on Claude Code, Anthropic's agentic coding tool that runs in your terminal. We will use Claude Code to carry out programming and data analysis tasks interactively, from your command line.
Anthropic offers two agentic AI tools. This session focuses on Claude Code CLI, but participants should be aware of Claude Cowork as well:
| Claude Code CLI | Claude Cowork | |
|---|---|---|
| Interface | Terminal (command line) | Claude Desktop GUI |
| Primary focus | Coding, programming, data analysis | Knowledge work (documents, spreadsheets, research) |
| Typical outputs | Code, scripts, plots, analysis pipelines | Excel with formulas, PowerPoint, formatted documents |
| Requires | Command line comfort | Just the desktop app |
| Runs on | Mac, Linux, Windows (WSL) | Mac, Windows (x64) |
| Authentication | API key (HUIT Bedrock for Harvard) | Paid Anthropic subscription (Pro, Max, Team, or Enterprise) |
| Harvard billing | Charged to PI's HUIT account | Personal subscription ($20+/month) |
If you have a paid Anthropic subscription and want to try Cowork:
For more details, see the Cowork getting started guide.
We will support Mac (macOS) systems for this workshop.
Open the Terminal application on your Mac: in Finder, go to Applications → Utilities → Terminal and double-click to launch it. You will use this window for all the steps below.
mkdir -p ~/GAIsandbox
cd ~/GAIsandbox
Check that Python 3 is available on your system:
which python3
You should see a path like /usr/bin/python3 or
/Library/Frameworks/Python.framework/.../python3.
If you get no output, you will need to
install Python 3
before continuing.
Create a file called hello.py with the following contents
(or download it with the curl command below):
print("Hello! Python is working correctly.")
print()
import sys
print(f"Python version: {sys.version}")
print(f"Python location: {sys.executable}")
To download directly into your current directory instead:
curl -O https://astrostubbs.github.io/GenAI-for-Scholarship/hello.py
Then run it:
python3 hello.py
You should see output like:
Hello! Python is working correctly.
Python version: 3.x.x (...)
Python location: /usr/bin/python3
Create a file called plottest.py with the following contents
(or download it with the curl command below):
import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(0, 4 * np.pi, 200)
y = np.sin(x)
plt.figure()
plt.plot(x, y)
plt.xlabel("x")
plt.ylabel("sin(x)")
plt.title("Sine Wave — Plot Test")
plt.grid(True)
plt.show()
To download directly instead:
curl -O https://astrostubbs.github.io/GenAI-for-Scholarship/plottest.py
Then run it:
python3 plottest.py
A window should appear showing a sine wave plot. Close the plot window to continue. If you get an error about missing packages, install them by running the following in your Terminal window:
pip3 install numpy matplotlib
Then run python3 plottest.py again in Terminal.
If both tests pass, you're ready to proceed.
Still in your Terminal window, install Claude Code with a single command:
curl -fsSL https://claude.ai/install.sh | bash
Full documentation: Claude Code installation and setup
Before launching Claude Code, you need to set environment variables that configure it to use Harvard's Bedrock endpoint. Use the API key from the link at the top of this page.
Create a file called trainingsetup.sh with the following
contents (or download it with the curl command below):
#!/bin/bash
export ANTHROPIC_BEDROCK_BASE_URL=https://apis.huit.harvard.edu/ais-bedrock-llm/v2
export ANTHROPIC_API_KEY=YourKeyHere
export ANTHROPIC_SMALL_FAST_MODEL=us.anthropic.claude-opus-4-5-20251101-v1:0
export CLAUDE_CODE_SKIP_BEDROCK_AUTH=1
export CLAUDE_CODE_USE_BEDROCK=1
To download directly instead:
curl -O https://astrostubbs.github.io/GenAI-for-Scholarship/trainingsetup.sh
Then make it executable:
chmod 755 trainingsetup.sh
Open trainingsetup.sh in nano (a simple terminal text editor):
nano trainingsetup.sh
Use the arrow keys to move the cursor to YourKeyHere on the second line.
Delete it and paste your API key in its place. Then:
Now source the file to set the environment variables:
source ./trainingsetup.sh
Your API key is like a password — treat it with the same level of security.
With the environment variables set, start Claude Code from your working directory:
cd ~/GAIsandbox
claude
You will be prompted to log in on first use. For this workshop we are using Harvard's API endpoint, so you do not need a personal Claude subscription.
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.
After the workshop, if you want to continue using Claude Code with your own Anthropic account, we recommend enabling sandboxed mode. This restricts Claude Code to your working directory and limits network access, giving you an extra layer of safety.
To enable sandboxing, launch Claude Code and type:
/sandbox
Select auto-allow mode from the menu. You can also download this settings file to enable it automatically at launch: sandbox-settings.json
claude --settings ./sandbox-settings.json
For more details, see the Claude Code sandboxing documentation.
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
Please take a moment to share your feedback — it helps us improve future sessions.