Skip to content

Setup

Complete these steps before the labcamp starts. If you run into issues, check Troubleshooting.

You will use a terminal (macOS Terminal or iTerm, Windows PowerShell or Git Bash, Linux your distro's terminal) and a code editor is optional for reading files.


1. Install uv

uv is a fast Python package manager. It also installs Python for you — no separate Python install required.

curl -LsSf https://astral.sh/uv/install.sh | sh

Restart your terminal, then verify:

uv --version
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

Restart your terminal, then verify:

uv --version

uv handles Python too

uv sync will automatically download and use Python 3.11+ if it is not already installed on your system.


2. Git

You need Git to clone this repository and to reset a lab with git checkout.

git --version

If that prints a version, skip to Claude Code.

Run Command Line Tools (includes Git):

xcode-select --install

Or install Git via Homebrew: brew install git.

Install Git for Windows. Use PowerShell or Git Bash for the shell commands in this guide.

# Debian / Ubuntu
sudo apt update && sudo apt install git

# Fedora
sudo dnf install git

# Arch
sudo pacman -S git

3. Install Claude Code

curl -fsSL https://claude.ai/install.sh | bash
claude --version
irm https://claude.ai/install.ps1 | iex
claude --version

Do not run claude yet

The labcamp uses Amazon Bedrock, not an Anthropic account login. You will configure it in section 5.


4. Clone and install dependencies

The commands below are identical on all operating systems:

git clone https://github.com/Storm-AI-Reply/ClaudeCode-Labcamp.git
cd ClaudeCode-Labcamp
uv sync

uv sync reads pyproject.toml, creates a virtual environment, and installs all dependencies in one step — no manual venv creation or activation needed.


5. Configure Claude Code for Amazon Bedrock

Reference: Claude Code on Amazon Bedrock.

The organizers will hand you:

  • AWS_BEARER_TOKEN_BEDROCK
  • AWS_REGION

In the terminal where you will launch claude, use the same simple Bedrock API key flow described in the official docs: export the bearer token and start Claude Code.

Bedrock API key (bearer token)

Official reference (Option E): Claude Code on Amazon Bedrock.

# Required for Claude Code + Bedrock
export CLAUDE_CODE_USE_BEDROCK=1
export AWS_REGION=eu-west-1
export AWS_BEARER_TOKEN_BEDROCK=your-bedrock-api-key
# Required for Claude Code + Bedrock
$env:CLAUDE_CODE_USE_BEDROCK = "1"
$env:AWS_REGION = "eu-west-1"
$env:AWS_BEARER_TOKEN_BEDROCK = "your-bedrock-api-key"

No spaces around =

Use export FOO=bar, not export FOO = bar. On PowerShell the syntax differs ($env:VAR = "value") but the same rule applies: no extra spaces inside the assignment.

New terminal tab or window?

Environment variables do not persist across sessions. If you open a new terminal, re-export the entire block above and relaunch claude before continuing.

If your shell is already configured for Bedrock and region, the essential key step is:

export AWS_BEARER_TOKEN_BEDROCK=your-bedrock-api-key

Then launch Claude Code:

claude

You should land directly at the prompt with no Anthropic login step.

Your credentials are temporary and personal

They are issued just for you. Do not share them. If they stop working (expired or revoked), ask an organizer for a fresh set.

Split terminal

Keep two panes open side by side: one for Claude Code, one for shell work (starting the server, running curl, checking logs). This avoids spending tokens asking Claude to run commands you can run directly. In VS Code or any IDE, right-click the terminal tab → Split Terminal.


6. Confirm the app runs

From the repository root:

cd labs/01-execution-model/starter
uv run uvicorn main:app --reload

Visit http://localhost:8000/docs. You should see the quiz-night API documentation page. Stop the server with Ctrl+C (same on all platforms).

Do not run pytest during setup

The Lab 01 starter has intentional bugs; fixing them is the exercise.


Hooks and MCP (all operating systems)

Lab hooks and MCP servers in .claude/settings.json use uv run python. Since uv run resolves the virtual environment automatically, no manual activation is ever required.

Example hook command:

{ "type": "command", "command": "uv run python .claude/hooks/guard_live.py" }

Example MCP server:

{ "command": "uv", "args": ["run", "python", "mcp_server/trivia_content_server.py"] }


Moving between labs

Before switching labs: run /exit inside Claude Code, then run the cd command in your shell, and relaunch claude in the new directory.

These paths assume you are at the starter/ root. If you are deeper in the directory tree, navigate back to starter/ first.

cd ../../../labs/02-project-configuration/starter    # from Lab 01 starter
cd ../../../labs/03-control-connect/starter          # from Lab 02 starter
cd ../../../labs/04-scale-reuse/starter              # from Lab 03 starter
cd ../../../labs/final-project/starter               # from Lab 04 starter

Resetting a lab

From inside a lab's starter/ folder:

git checkout -- .

That restores tracked files to the last commit. Requires Git (section 2).


Troubleshooting

uv: command not found

Restart your terminal after installation. If still missing, re-run the installer from astral.sh/uv.

uv run fails with No such file or directory

Run uv sync from the repo root first to create the virtual environment and install dependencies.

git: command not found

Install Git (section 2) and open a new terminal window.

uv run pytest or uv run uvicorn shows ModuleNotFoundError

Run uv sync from the repo root. Make sure you are running from within the cloned repo.

Port 8000 already in use

Use a different port: uv run uvicorn main:app --reload --port 8001

Quiz data disappeared

The app uses in-memory storage. Restarting uvicorn wipes all data; keep the server running throughout each lab.

claude starts but asks for an Anthropic login

Your CLAUDE_CODE_USE_BEDROCK=1 env var is missing in this terminal. Re-export the block from section 5 and start claude again.

Bedrock error: ExpiredTokenException or AccessDenied

Your Bedrock API key expired or was revoked. Ask an organizer for a fresh key and re-export it.

Bedrock error mentions bearer token / CallWithBearerToken denied

Your Bedrock API key path was blocked by an organizer kill switch. Ask for a new token or for the group revoke policy to be disabled.

Bedrock error: model not available in region

You are using a region that doesn't match the one the organizers assigned. Re-export AWS_REGION with the value on your sheet.

Phones cannot connect (Final Project)

Start the server with --host 0.0.0.0 and use your laptop's local IP (not localhost). Phones must be on the same Wi‑Fi.

MCP server not connecting

Check that "command" is "uv" and "args" starts with ["run", "python", ...], the configured path matches your MCP server file, you restarted Claude after editing settings, and /mcp lists the tools.