Investigating with AI

Data analysis for the social sciences, with Claude Code.

This page gets you from a laptop to a working environment. Read it in order the first time — about twenty-five minutes. You do not need to have used a terminal before.

You will be given two things privately: a username and a password. They work for everything on this page.

What you are connecting to

A Linux server, on the internet, that you share with the rest of the course. It already has Python, Node.js, Claude Code, git, Quarto and the analysis libraries installed. Your work lives there, not on your laptop, which means:

You work in two places. Your own home directory is private to you. Your project directory is shared with your project group and invisible to everyone else. Both are explained below.

1. Open a terminal

A terminal is a window where you type commands instead of clicking. Every operating system ships one.

macOS — press Cmd + Space, type Terminal, press Enter.

Windows — press the Start key, type PowerShell, press Enter. Do not use the old "Command Prompt".

Linux — press Ctrl + Alt + T.

You will see a line ending in $ or >. That is the prompt: it is waiting for you. Type a command, press Enter, read what comes back. That is the whole interaction model.

Three commands worth knowing before anything else:

pwd      # print working directory - where am I?
ls       # list - what is here?
cd name  # change directory - go into the folder called "name"

cd .. goes back up one level. cd on its own returns you home.

2. Connect with SSH

SSH is how you log in to the server. Same command on all three systems:

ssh yourlogin@investigatingwithai.com

The first time, you will see a warning about the authenticity of the host and a long fingerprint. Type yes and press Enter. This happens once.

Then it asks for your password. The cursor will not move while you type. No dots, no stars, nothing. That is deliberate — type it anyway and press Enter.

You are in when the prompt changes to something like yourlogin@investigating:~$.

Change your password now:

passwd

Stop typing your password every time

Key-based login is both easier and safer. Run this on your own computer, once:

ssh-keygen -t ed25519      # press Enter three times to accept the defaults
ssh-copy-id yourlogin@investigatingwithai.com

On Windows, if ssh-copy-id does not exist:

type $env:USERPROFILE\.ssh\id_ed25519.pub | ssh yourlogin@investigatingwithai.com "mkdir -p ~/.ssh && chmod 700 ~/.ssh && cat >> ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys"

From then on ssh yourlogin@investigatingwithai.com just lets you in.

To leave, type exit.

3. Your space

~                        your home. Private. Nobody else can read it. 25 GB.
~/projects/              your individual work
~/project-<name>/        your project group's folder - shared with your team only
~/datasets-shared/       reference datasets, read-only
~/class-common/          scratch space for the whole course

~ is shorthand for your home directory.

Individual versus project work. Your home directory is yours: no other student can list it, open it, or copy from it. Your project directory is the opposite — everyone in your group can read and edit everything in it, and nobody outside the group can see it at all, not even its file names.

That has a consequence worth taking seriously: inside a project folder, your teammates can overwrite and delete your files. There is no undo. Use git, commit often, and treat the folder as a shared table rather than a safe.

Check how much space you have left:

quota -s

Find what is using it:

du -sh ~/* | sort -h

Raw data you can download again does not belong in your home directory.

4. Moving files with SFTP

SFTP transfers files over the same connection as SSH. Nothing extra to install on the server, nothing extra to configure.

With a graphical client

Install FileZilla (all systems), Cyberduck (macOS, Windows) or WinSCP (Windows). Then:

Field Value
Protocol SFTP — SSH File Transfer Protocol
Host investigatingwithai.com
Port 22
Logon type Normal
User your login
Password your password

The single most common mistake is choosing plain "FTP" from the protocol list. It will not connect. It must say SFTP.

You then get two file panes: your laptop on the left, the server on the right. Drag between them.

From the terminal

sftp yourlogin@investigatingwithai.com
put survey.csv  projects/         # upload
get outputs/figures/plot.png      # download
bye

For a whole folder, rsync is faster and resumable:

rsync -av ./my-analysis/ yourlogin@investigatingwithai.com:~/projects/my-analysis/

5. Get the project template

Every project starts from the same template — folder layout, conventions, the report scaffold and the Claude Code configuration are already in it.

The template repository is private, so you have to connect your GitHub account once before you can clone it:

gh auth login

Choose GitHub.com, then HTTPS, then login with a web browser. It shows you a one-time code; open the URL on your own computer, paste the code, and approve. You only do this once per account.

Tell your teacher your GitHub username if you have not already — without it you cannot be granted access.

Then:

cd ~/projects
git clone REPO_URL_PLACEHOLDER my-analysis
cd my-analysis
uv sync

Working as a group? Clone it into your project folder instead, so your teammates can reach it:

cd ~/project-<yourgroup>
git clone REPO_URL_PLACEHOLDER analysis

6. Working without losing your work

If your connection drops, anything still running dies with it. tmux fixes that:

tmux                  # start a persistent session
# ... run your long job ...
# press Ctrl-b then d  -> detaches, leaves it running
tmux attach           # come back later, from anywhere

Editing files

nano file.py is the editor to start with — arrow keys work, Ctrl-O saves, Ctrl-X exits, and the shortcuts are listed at the bottom of the screen.

If you already use VS Code, install the Remote — SSH extension and connect to investigatingwithai.com. You then edit files on the server with the full editor, and its built-in terminal is already logged in. This is the most comfortable setup for most people.

Most of the time, though, you will ask Claude Code to make the edit.

7. The toolchain

Everything below is already installed on the server.

There is a separate page listing the commands worth knowing — skim it once now, and come back to it when you need something.

Everything is already installed

A shared environment holds pandas, polars, duckdb, statsmodels, linearmodels, scikit-learn, xgboost, lightgbm, shap, PyTorch, transformers, spaCy (English and French), NLTK, gensim, BERTopic, geopandas, networkx, plotly and the Claude API client. You do not have to install any of it.

course-python                  # a Python REPL with all of it available
course-python myscript.py      # run a script with it
course-jupyter lab --no-browser --port 8888

In JupyterLab it is the kernel called Course (data science).

Use it to explore. Use uv inside a project for anything you hand in — the shared environment is read-only and shared, so it cannot record what your analysis depends on, and that record is what makes a result reproducible.

Your own project environment

Python in a project is managed by uv, not pip. Inside a project folder:

uv sync                  # create the environment from pyproject.toml
uv run python script.py  # run something inside it
uv add pandas            # add a package
uv run jupyter lab --no-browser --port 8888

Never pip install. uv records what you installed so your project stays reproducible; pip does not.

JupyterLab in your browser

You do not need the terminal for this at all. Open:

https://investigatingwithai.com/jupyter

Sign in with the same username and password you use for SSH. There is no separate Jupyter account and no token to copy.

You get your own JupyterLab, opened in your own home directory, with your project folders visible in the file browser on the left. Pick the kernel Course (data science) and everything listed above is already importable.

Three things worth knowing:

bash uv add --dev ipykernel uv run python -m ipykernel install --user --name my-project --display-name "My project"

It then appears in the kernel list alongside Course (data science).

Jupyter from the terminal instead

If you prefer running it yourself, or you want a version the Hub does not provide, start it on the server and forward the port from your own machine in a second terminal:

Node.js and JavaScript for the interactive parts of your report:

node --version
npm install -g <package>     # works without sudo; installs into your home

Machine learning in your own project: uv sync --group ml adds scikit-learn, xgboost, lightgbm and shap. That is a few gigabytes against your quota, so add it only where you need it — or just use course-python, which already has all of it and costs you nothing.

One package needs care on this server. Its processor is from 2013 and lacks some instructions that recent builds of polars assume; the normal package crashes outright. Install polars-lts-cpu instead of polars and everything works identically. The shared environment already has the right one.

Claude Code — install it once into your account:

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

Login opens a browser, and the server has no browser. Press c, open the URL on your own computer, sign in with your course account, and paste the code back into the terminal.

Calling Claude from your own Python code is a different thing from using Claude Code, and it is billed separately. It needs an API key your instructor has to provide. Ask before you build anything that depends on it.

Quarto and Pandoc turn a document with embedded code into a formatted report: quarto render report.qmd.

git and GitHub are how you keep your work and hand it in:

git init && git add -A && git commit -m "first commit"
gh auth login
gh repo create my-analysis --private --source=. --push

Keep data out of git. The template's .gitignore already does this; do not override it. Survey microdata committed once is effectively permanent.

8. Seeing your report

Your report is HTML, and HTML has to be served rather than opened as a file. On the server:

cd ~/projects/my-analysis
npm run dev            # serves it on port 8080

In a second terminal on your own computer:

ssh -L 8080:localhost:8080 yourlogin@investigatingwithai.com

Then open http://localhost:8080. The same trick as Jupyter: the server does the work, your browser does the looking.

When something goes wrong

"Permission denied, please try again." Wrong username or password. Both are case-sensitive. Ask for a reset instead of guessing repeatedly.

"Connection refused", or it hangs forever. Some university and hotel networks block port 22. Tether to your phone to check, then tell your teacher.

Locked out after several tries. The server blocks an address for 15 minutes after 8 failures. Wait; it clears itself.

"Disk quota exceeded". You have hit 25 GB. du -sh ~/* | sort -h shows where it went.

"command not found". Either a typo, or you are on your own laptop when you meant to be on the server. Check the prompt.

You broke something in your project. If it is in git, git status and git checkout -- <file> undo it. This is what git is for.

Ask early. A question in week one costs five minutes; the same question in week six costs a deadline.

Where to go next

Student setupInstalling Claude Code and uv on your own laptop, and the course rules.Server accessReference card: SFTP client settings, ports, quotas, troubleshooting.CommandsThe commands worth knowing, from ls to duckdb. Skim once, return often.Project conventionsThe data-handling and statistical conventions this course works under.Project templateLayout of the analysis repository and the commands available.