Setup

Complete this before the session — takes about 10 minutes.

Save this for later
This site may not be hosted permanently. Use your browser’s Print → Save as PDF to save any page while the site is live. Each task page also has a save button at the top right.

Primary surface: VS Code with the Claude Code extension.

Every step is shown using the VS Code extension.
The same steps also work in the Claude Code CLI — CLI-specific commands are noted where they differ.

What you need

Can't install something?
Follow the steps on screen during the session and complete them afterwards.

Choose a project to work in

All tasks run inside a project folder. Pick the option that suits you — your choice is remembered if you navigate away.

signup-api (sample project)

You'll create signup-api — a small web API with a known validation bug. It makes the sample project feel realistic — small enough to hold in your head.

1

Create the project folder and initialise git.

signup-api/ ← project root

Create a signup-api folder, then open it in VS Code: File → Open Folder.

Initialise git. In the VS Code integrated terminal (Terminal → New Terminal):

git init
2

Create .python-version — one line, no quotes.

signup-api/
└── .python-version ← create this

Create .python-version.

Paste the content and save (Cmd+S / Ctrl+S):

3.12
3

Create pyproject.toml.

signup-api/
├── pyproject.toml ← create this
└── .python-version

Create pyproject.toml.

Paste the content and save (Cmd+S / Ctrl+S):

[project]
name = "signup-api"
version = "0.1.0"
description = "Lightweight sign-up validation service."
requires-python = ">=3.12"
dependencies = [
    "fastapi>=0.115",
    "uvicorn>=0.32",
]

[dependency-groups]
dev = [
    "httpx>=0.27",
    "pytest>=8",
    "ruff>=0.8",
]

[tool.pytest.ini_options]
pythonpath = ["."]

[tool.ruff]
line-length = 100
target-version = "py312"

[tool.ruff.lint]
select = ["E", "F", "I", "B", "UP"]
4

Create main.py — the sign-up endpoint and validation.

signup-api/
├── main.py ← create this
├── pyproject.toml
└── .python-version

Create main.py.

Paste the content and save (Cmd+S / Ctrl+S):

"""Sign-up validation service."""

from fastapi import FastAPI
from fastapi.responses import JSONResponse
from pydantic import BaseModel

app = FastAPI(title="signup-api")


class SignUpRequest(BaseModel):
    email: str
    name: str


def _validate_email(email: str) -> str | None:
    """Return an error string, or None if the email looks valid."""
    if "@" not in email:
        return "must contain @"
    local, domain = email.split("@", 1)
    if not local:
        return "local part is empty"
    if "." not in domain:
        return "domain must contain a dot"
    return None


def _validate_name(name: str) -> str | None:
    """Return an error string, or None if the name looks valid."""
    if not name:
        return "must not be blank"
    return None


@app.post("/signup")
def sign_up(body: SignUpRequest):
    """Register a new user.

    Returns 200 {"message": "signed up"} on success, or
    400 {"error": "<field>: <reason>"} on bad input.
    """
    if err := _validate_email(body.email):
        return JSONResponse(status_code=400, content={"error": f"email: {err}"})
    if err := _validate_name(body.name):
        return JSONResponse(status_code=400, content={"error": f"name: {err}"})
    return {"message": "signed up"}
5

Create test_main.py — existing tests that must keep passing after your fix.

signup-api/
├── test_main.py ← create this
├── main.py
├── pyproject.toml
└── .python-version

Create test_main.py.

Paste the content and save (Cmd+S / Ctrl+S):

"""Tests for the sign-up endpoint."""

from fastapi.testclient import TestClient

from main import app

client = TestClient(app)


def test_valid_signup():
    r = client.post("/signup", json={"email": "user@example.com", "name": "Alice"})
    assert r.status_code == 200
    assert r.json() == {"message": "signed up"}


def test_name_with_spaces():
    # Existing clients send full names; must not regress.
    r = client.post("/signup", json={"email": "user@example.com", "name": "John Smith"})
    assert r.status_code == 200


def test_missing_at_symbol():
    r = client.post("/signup", json={"email": "notanemail", "name": "Alice"})
    assert r.status_code == 400
    assert r.json()["error"].startswith("email:")


def test_empty_name():
    r = client.post("/signup", json={"email": "user@example.com", "name": ""})
    assert r.status_code == 400
    assert r.json()["error"].startswith("name:")


def test_error_shape():
    # Error response must always be {"error": "<field>: <reason>"}.
    r = client.post("/signup", json={"email": "bad", "name": "Alice"})
    body = r.json()
    assert set(body.keys()) == {"error"}
    assert ":" in body["error"]
6

Install dependencies and verify the tests pass.

In the VS Code integrated terminal:

uv sync
uv run pytest -q
Done when
The output ends with 5 passed. That's your starting point.
7

Open the project in VS Code and open the Claude Code panel.

The workspace root is signup-api/. All tasks happen inside this folder.

signup-api/ ← VS Code workspace root
├── test_main.py
├── main.py
├── pyproject.toml
└── .python-version

Keep this page open in a browser tab alongside VS Code — you'll copy settings snippets from here during the session.