Module 1 — Weeks 1-2

Claude Code & AI Tools Mastery

Before you learn ML, master the tool you'll use to build everything. Claude Code isn't just autocomplete — it's agents, automation, plugins, and a completely different way to write software. This module makes you dangerous with it.

Week 1

Claude Code Fundamentals + Prompt Engineering

Goal: Set up Claude Code as your primary development tool. Learn the core commands, configuration, and prompt engineering patterns that make vibe coding actually work for biology.
Setup & Core Commands (45 min)

Claude Code is a CLI tool that gives you an AI pair programmer in your terminal. It can read files, write code, run commands, search your codebase, and manage git — all through natural language.

# Install Claude Code (if not already installed) npm install -g @anthropic-ai/claude-code # Start Claude Code in any project directory cd ~/Projects/my-bio-project claude # Essential commands to know /help # See all available commands /init # Create a CLAUDE.md for project context /clear # Clear conversation history /compact # Compress conversation to save context /cost # See how much you've spent this session /model # Switch between Claude models
CLAUDE.md — Your Project Brain

The most important file for vibe coding. CLAUDE.md sits in your project root and tells Claude everything it needs to know about your project. Claude reads it automatically every session.

Example CLAUDE.md for a Bio Project
# Compound Tox Explorer ## What this project does Analyzes synthetic small-molecule toxicogenomics data to explore compound toxicity patterns using EDA and classical ML. Personal portfolio project — all data is synthetic to keep this independent of any employer work. ## Tech stack - Python 3.11, pandas, scikit-learn, seaborn, plotly - Jupyter notebooks for exploration, .py files for reusable functions - Data lives in /data (not committed to git) ## Conventions - Use snake_case for all functions and variables - Every notebook should have a markdown cell at the top explaining what it does - Figures saved to /figures as both PNG (for README) and PDF (for publication) - Use log2(TPM+1) normalization for gene expression data ## Biology context - We're analyzing small-molecule compound toxicity patterns - Key endpoints: hepatotoxicity (ALT/AST/GGT elevation), oxidative stress, apoptosis (caspase activation) - Compound classes: four generic mechanism categories (Class A/B/C/D) — fully synthetic - Gene panel: universal liver/stress markers plus a broader transcriptomic panel ## Current status - Data downloaded and cleaned - EDA notebook complete - Working on classification model

Why this matters: A good CLAUDE.md means you spend less time re-explaining context every session. It's like a lab notebook for your AI assistant — the more context it has, the better its suggestions.

Prompt Engineering for Biology Code (1 hr)

The difference between good and bad vibe coding is prompt quality. Here are patterns that work specifically for biological data science.

Pattern 1: Context-First Prompts
Bad: "Make a heatmap" Good: "I have an RNA-seq count matrix (rows = genes, columns = samples) stored in a DataFrame called `expr_df`. The first 5 columns are IFN-treated macrophages, the last 5 are untreated controls. Create a clustermap of the top 50 most variable genes across all samples, with a column color bar showing treatment condition. Use a diverging colormap centered on 0 (blue-white-red) since this is z-score normalized expression."
Pattern 2: Specify Output Format
"Write a function called `compute_compound_descriptors(smiles: str) -> dict` that takes a SMILES string and returns a dictionary with: molecular_weight (float, Da), logP (float, RDKit Crippen), num_h_bond_donors (int), num_h_bond_acceptors (int), num_rotatable_bonds (int), tpsa (float, topological polar surface area), passes_lipinski (bool, all four Ro5 rules). Include type hints, a docstring with a worked example using aspirin (CC(=O)Oc1ccccc1C(=O)O), and raise ValueError for invalid SMILES."
Pattern 3: Iterative Refinement
"The volcano plot looks good but: (1) increase font size to 12pt for publication, (2) add a dashed horizontal line at -log10(0.05), (3) only label genes from this list: [MX1, IFIT1, ISG15, OAS1, STAT1] since those are known ISGs, (4) save as both PNG 300dpi and PDF vector format."
Pattern 4: Explain the Biology, Let Claude Handle the Code
"I need to normalize my flow cytometry data. The raw data is MFI (median fluorescence intensity) values for 8 markers across 96 samples in a plate. Some wells are unstained controls (column 1), single-stain controls (column 2), and FMO controls (column 3). The rest are experimental samples. Apply compensation-like subtraction of FMO background, then normalize each marker to the 99th percentile across all experimental samples so values are roughly 0-1."
Pattern 5: Show Me the Data First
Bad: jumping straight to "build a classifier on data/compound_tox.csv" Good: "Read data/compound_tox.csv and tell me: shape, dtypes, missing-value counts per column, summary statistics for numeric columns, value counts for categorical columns, and any obvious data-quality issues (constant columns, suspicious ranges, duplicate rows). Don't model anything yet — just describe what's in the file." Then in your next prompt: "Given what you found, what's the cleanest way to set up a binary classifier for hepatotox_label?"

Why it matters: Skipping this step is how you end up with models trained on leaked features or NaN-filled garbage. Always force Claude to describe the data before transforming it.

Pattern 6: Specify What NOT to Do (Constraints)
"Build a hepatotox classifier on data/compound_tox.csv (target = hepatotox_label). Constraints — these matter: - Do NOT use any of the *_fold_change columns as features. Those derive from the label and would leak. - Do NOT impute missing values with column means before splitting. Fit imputers on train only. - Do NOT use accuracy as the headline metric — classes are imbalanced. Use ROC-AUC and PR-AUC. - Do NOT use a stock train_test_split. Stratify on hepatotox_label so test set has the same prevalence. - Do NOT install new packages without telling me first."

Why it matters: Claude will produce reasonable-looking code that does subtly wrong things (data leakage, wrong metric, unstratified splits) unless you forbid them. Stating constraints up front is faster than catching the bugs in code review.

Pattern 7: Ask Claude to Validate Its Own Output
"After training the classifier, run these sanity checks and tell me if anything looks suspicious: 1. ROC-AUC on training set vs. test set — if train >> test, flag as overfitting. 2. Permutation importance for the top 5 features — if a single feature dominates with importance > 0.5, flag as possible leakage. 3. Prediction distribution on the test set — if >95% of predictions are one class, flag as a degenerate model. 4. Confusion matrix at the default 0.5 threshold and at the threshold that maximizes F1. For any flag, propose what to investigate next. Don't fix anything yet — just diagnose."

Why it matters: Claude is good at finding problems if you ask it to. The same model that "looks great" in the first response often has obvious issues when you specifically request a critique.

Key Principle
  • You are the biologist, Claude is the programmer. Your job is to describe WHAT you need in biological terms and EVALUATE if the output is scientifically correct. Claude's job is to write the code. The more biological context you give, the better the code.
  • Never accept code you don't understand conceptually. Ask Claude to explain what it's doing. You don't need to understand every syntax detail, but you need to know the logic.
  • If your prompt is shorter than three sentences, you probably haven't given enough context. Domain words ("Hy's law", "log2 fold-change", "Z-factor") are free context — use them.
  • One prompt = one decision. Don't bundle "load data + clean + train + plot + interpret" into one ask. Each step has decisions you should review before the next one.
Common Pitfalls
  • Magic-fixing. Pasting an error and saying "fix it" makes Claude guess at the cause. Better: paste the error AND describe what you were trying to do.
  • Premature aesthetics. Don't burn turns on plot polish before you trust the analysis. Get the numbers right, then style.
  • Trusting the first answer on a hard biology call. If Claude makes a non-trivial scientific judgment ("I dropped genes with TPM < 1 in >80% of samples"), challenge it: ask why, ask what an alternative threshold would change.
  • Letting Claude pick the random seed. If you can't reproduce a result, you can't show it. Fix seeds explicitly in every prompt that involves randomness (splits, model init, sampling).
Permission Modes & Safety

Claude Code has permission modes that control how much autonomy it has. Cycle through them in any session by pressing Shift+Tab — the active mode shows in the status line.

ModeWhat HappensWhen to Use
defaultAsks before running shell commands or editing filesDefault for any work that matters
acceptEditsAuto-accepts file edits, still asks for shell commandsActive coding sessions where you're reviewing diffs as they land
planRead-only — Claude can search and read but cannot edit or run anythingWhen you want a plan without touching the codebase
bypassPermissionsAuto-accepts everything, including shell commands ("YOLO mode")Sandboxes and throwaway experiments only. Never on a real codebase.

Set a default for new sessions: add "defaultMode": "acceptEdits" to ~/.claude/settings.json. Don't put bypassPermissions there — opt into it per-session.

Practice Dataset (Synthetic Compound Toxicity)

Throughout Module 1 we use a small synthetic toxicology dataset. It's intentionally fake: no real compounds, no real biology — just realistic shape and distributions so you can practice prompting on something that looks like a real EDA problem.

Schema: 100 rows. Columns — compound_id (str), compound_class (A/B/C/D), molecular_weight (Da), logP, dose_uM, alt_fold_change, ast_fold_change, ggt_fold_change, hepatotox_label (0/1, positive if any FC > 3).

Generate it once at the start of the project. Paste this into Claude Code — this prompt itself is Pattern 4 (biology-first):

Generate the practice dataset
Generate a synthetic compound toxicity dataset and save as data/compound_tox.csv. 100 compounds. Columns: compound_id (str like "CMP001"), compound_class (one of: A, B, C, D — pick uniformly), molecular_weight (float, 200-800 Da), logP (float, -1 to 6), dose_uM (log-spaced from 0.1 to 100), alt_fold_change (1.0-15, log-normal noise — Class B and D should average ~3x higher than A and C), ast_fold_change (correlated with ALT, ratio noise ~10%), ggt_fold_change (similar pattern), hepatotox_label (binary: 1 if any of ALT/AST/GGT > 3, the standard fold-change threshold). Use a fixed random seed for reproducibility. Add a docstring at the top of the script explaining the schema.

Why synthetic: A toy dataset removes data wrangling as a confounder while you learn prompting. Once you're comfortable, every later module uses real public data (GEO, ChEMBL, BBBC, FAERS).

Project: Dev Environment Setup

GitHub repo: bench2bytes-workspace

What to do:

  1. Create a GitHub account (if you don't have one) and a new repo
  2. Clone it locally and initialize Claude Code (claude in the directory)
  3. Create a CLAUDE.md using the template above — rename the project to something that's not a conflict of interest with your day job
  4. Ask Claude to create a Python project scaffold: requirements.txt, /src, /notebooks, /data, /figures, .gitignore
  5. Generate the practice dataset using the prompt above
  6. Run the 5-prompt practice exercise below — one prompt for each of the patterns
  7. Push to GitHub with a clean README explaining what each prompt was practicing
5-Prompt Practice Exercise
Prompt 1 — Pattern 1 (Context-first): "I have a CSV at data/compound_tox.csv with 100 compounds. Columns: compound_id, compound_class (A/B/C/D), molecular_weight (Da), logP, dose_uM, alt_fold_change, ast_fold_change, ggt_fold_change, hepatotox_label (0/1). Make a strip plot of alt_fold_change on the y-axis grouped by compound_class on the x-axis, with hepatotox_label as the hue (0 = blue, 1 = red). Add a horizontal dashed line at fold-change = 3. Use a log scale on the y-axis. Save to figures/alt_by_class.png at 300dpi." Prompt 2 — Pattern 2 (Specify output format): "Write a function `compute_tox_features(row: pd.Series) -> dict` in src/features.py that takes one compound row and returns: max_fold_change (float, max of ALT/AST/GGT FCs), n_elevated_markers (int, count of markers with FC > 3), tox_severity (str: 'none' if max FC < 2, 'mild' if 2-3, 'moderate' if 3-5, 'severe' if >5), is_high_risk (bool: True if alt_fold_change > 3 AND ast_fold_change > 3). Include type hints, a docstring with a worked example, and raise ValueError if any required column is missing." Prompt 3 — Pattern 3 (Iterative refinement, run after Prompt 1): "The strip plot from figures/alt_by_class.png is close but: (1) make points size 8 with alpha 0.7, (2) increase font sizes to 12pt, (3) overlay the median ALT FC per class as a black horizontal bar, (4) order classes by ascending median ALT FC, (5) save as both PNG (300dpi) and PDF." Prompt 4 — Pattern 4 (Biology-first): "I want to know whether lipophilicity (logP) predicts hepatotoxicity. Textbook claim: highly lipophilic compounds (logP > 3) accumulate in hepatocytes and disrupt mitochondrial function. Compute Spearman correlation between logP and alt_fold_change overall and per compound_class. Make a scatter plot of logP vs alt_fold_change colored by class with a LOWESS trend per class. Tell me whether the data supports the claim, including class-specific exceptions." Prompt 5 — Combination (Patterns 1 + 2): "Write a notebook at notebooks/01_compound_eda.ipynb. Cell 1 (markdown): title + dataset description. Cell 2 (code): imports. Cell 3: load + shape/dtypes/head. Cell 4: missing-value check + summary stats. Cell 5: histogram of alt_fold_change (log scale) with FC=3 line. Cell 6: boxplot of alt_fold_change by class with sample sizes. Cell 7: correlation heatmap of numeric columns. Cell 8 (markdown): 3-5 bullet summary. Save figures to figures/eda/ as PNG."
What to look for as you practice
  • Did Claude ask any clarifying questions? If so, what was missing from your prompt?
  • Did the output match what you pictured? If not, was it the prompt or your mental model that was off?
  • For Prompt 4 specifically: does Claude's biological interpretation match the data, or is it confidently wrong? This is the "you validate the science" muscle.
Week 2

Agents, MCP, Hooks & Automation

Goal: Go beyond basic prompting. Learn how Claude Code's advanced features — agents, MCP servers, hooks, and custom commands — let you build automated scientific workflows.
Agents & Sub-Agents

Claude Code can spawn "sub-agents" — separate Claude instances that handle specific sub-tasks. Think of it like delegating to a research assistant who goes away, does the work, and reports back.

How Agents Work
When you give Claude Code a complex task, it can automatically: 1. Break it into sub-tasks 2. Spawn agents to handle each one in parallel 3. Combine the results Example: "Analyze all CSV files in /data, create a summary statistics table for each, identify the 3 most interesting patterns, and write a combined report." Claude Code will: - Agent 1: Read and summarize file1.csv - Agent 2: Read and summarize file2.csv - Agent 3: Read and summarize file3.csv - Main: Combine findings into a report This happens automatically for complex tasks. You don't need to orchestrate it.

Bio application: Ask Claude to "read all the notebooks in this project, understand the analysis pipeline, and suggest what's missing" — it will use agents to read each notebook in parallel and synthesize.

MCP Servers — Connecting Claude to External Tools

MCP (Model Context Protocol) lets Claude Code connect to external services as plugins. Think of MCP servers as lab instruments that Claude can now operate directly.

# Configure MCP servers in your settings # File: ~/.claude/settings.json { "mcpServers": { "filesystem": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", "/Users/you/Projects"] }, "github": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-github"], "env": { "GITHUB_TOKEN": "your-token-here" } } } }

Useful MCP servers for bio-data work:

MCP ServerWhat It DoesBio Use Case
FilesystemRead/write files outside projectAccess data in shared drives
GitHubCreate issues, PRs, manage reposAutomate project management
Fetch/WebFetch web content and APIsPull data from PubMed, UniProt, GEO
SQLiteQuery databasesQuery local experiment databases
Google DriveAccess Google WorkspacePull data from shared lab folders
Hooks — Automating Workflows

Hooks are shell commands that run automatically in response to Claude Code events. Like triggers on your automation platform.

# Example hook configuration in settings.json # Auto-format Python files after Claude edits them { "hooks": { "postToolUse": [ { "matcher": { "tool": "edit", "glob": "*.py" }, "command": "black $FILE_PATH" } ] } }

Useful hook patterns:

  • Auto-lint: Run ruff or black after every Python file edit
  • Auto-test: Run relevant tests after code changes
  • Auto-format notebooks: Clean notebook outputs after edits
  • Notifications: Send a message when a long task completes
Custom Slash Commands

Create reusable commands for tasks you do repeatedly. Save them as markdown files in .claude/commands/.

# File: .claude/commands/eda.md # Usage: /eda filename.csv Run exploratory data analysis on the file: $ARGUMENTS 1. Load the data and show shape, dtypes, and first 5 rows 2. Show missing value counts per column 3. For numeric columns: descriptive statistics + distribution plots 4. For categorical columns: value counts + bar plots 5. Correlation heatmap for numeric features 6. Identify potential outliers (>3 SD from mean) 7. Summarize key findings in 3-5 bullet points Save all figures to /figures/eda/ and create a summary markdown file.
# File: .claude/commands/bio-features.md # Usage: /bio-features sequences.csv Compute biological features for the sequences in $ARGUMENTS: 1. Read the sequence column from the CSV 2. For each sequence calculate: - GC content, length, molecular weight estimate - Dinucleotide frequencies (all 16) - Longest homopolymer run - Predicted melting temperature (nearest-neighbor) - Number of CpG dinucleotides 3. Return as a new DataFrame merged with original data 4. Save feature correlation heatmap to /figures/
Custom Commands to Create
  • /eda [file] — Run standardized exploratory data analysis
  • /bio-features [file] — Compute biological sequence features
  • /model-compare [file] [target] — Train and compare 3 models on a dataset
  • /pub-figure [notebook] — Export all figures as publication-quality PDFs
  • /readme — Generate a README from the project's current state
Using Claude as API (Python SDK)

For programmatic use in your projects (like the literature mining tool in Module 4), you'll use the Anthropic Python SDK.

pip install anthropic
Quick API Example
import anthropic client = anthropic.Anthropic() # reads ANTHROPIC_API_KEY from env message = client.messages.create( model="claude-sonnet-4-20250514", max_tokens=1024, messages=[ { "role": "user", "content": "Extract the target gene and compound type from this abstract: ..." } ] ) print(message.content[0].text)

When to use CLI vs API: Use Claude Code CLI for interactive development and exploration. Use the API when you're building a tool that needs Claude inside a script (like extracting data from 100 papers programmatically).

Project: Automated Lab Data Processor

GitHub repo: lab-data-processor

Dataset: Create synthetic plate reader data (96-well format) with absorbance readings at multiple timepoints. Or use your own lab data if available. Template provided in prompts below.

What to build:

  1. Create a CLAUDE.md tailored for this project
  2. Build custom slash commands:
    • /plate-qc — Run QC checks on plate reader data (CV of replicates, Z-factor, edge effects)
    • /dose-response — Fit dose-response curves and calculate IC50
  3. Use Claude Code to build a Python script that:
    • Reads plate reader CSV files
    • Maps well positions to sample names using a plate map
    • Calculates Z-factor, CV%, signal-to-noise ratio
    • Fits dose-response curves (4-parameter logistic)
    • Exports a summary report with figures
  4. Push to GitHub with a README explaining the workflow
Prompts to Use
Generate synthetic 96-well plate reader data for a dose-response experiment. 8 doses (3-fold dilution from 100 uM) in columns 2-9, each in triplicate (rows A-C for compound 1, rows D-F for compound 2). Column 1 = vehicle controls, columns 10-12 = positive controls. Add realistic noise (CV ~10%) and a sigmoidal dose-response with IC50 around 5 uM for compound 1 and 15 uM for compound 2. Save as CSV with well position, absorbance, timepoint columns.
Build a plate QC module that takes raw plate reader data and calculates: (1) Z-factor from positive and negative controls, (2) CV% of replicates for each condition, (3) edge effect analysis (compare perimeter wells vs. interior), (4) flag any wells with >3 SD deviation from replicate mean. Return a QC summary dict and a visual plate heatmap.
Write a dose-response fitting function that takes concentrations and responses, fits a 4-parameter logistic curve (Hill equation), and returns IC50, Hill slope, top, bottom, R-squared, and 95% CI for IC50. Plot the fitted curve with data points and error bars. Handle cases where the curve doesn't converge.
What You're Learning
  • CLAUDE.md as project documentation — Forces you to think about project structure upfront
  • Custom commands as reusable workflows — Like SOPs but for code. Run the same analysis consistently.
  • Vibe coding a real tool — You describe the biology, Claude writes the code. You validate the science.
  • This project translates directly to your GSK work — plate QC and dose-response are daily tasks.

Module 1 Resources

Claude Code Documentation

API & SDK

Make sure you've pushed both projects to GitHub before completing.