Lab 8 · Build a Camera-Trap Pipeline Using Claude Code

Worth: 20 points  |  Due: end of Day 4  |  Files to submit: the project directory (code + CLAUDE.md + a prompts.md file with every prompt you used), the final tidy CSV final_detections.csv, and a 1-page PDF reflection.
Pre-reading: Claude Code setup and dos & don'ts.

What's different about this lab

You will not write the code. Claude Code will. You will be graded on the quality of your prompts, not on the lines of code. The whole point is to learn what an effective AI-assisted research workflow looks like.

The pipeline you need to build

Given a folder of raw camera-trap JPEGs from multiple cameras, produce a single tidy CSV with one row per detection:

image_id, camera_id, datetime, species_pred, species_confidence,
det_x1, det_y1, det_x2, det_y2, det_confidence

It must:

  1. Walk a directory recursively, reading EXIF timestamps.
  2. Run MegaDetector for animal localization.
  3. For every animal crop, run your Lab 5 species classifier.
  4. Write the tidy CSV.
  5. Skip images that have already been processed (resumable).
  6. Be runnable from a one-line command: python pipeline.py --input X --output Y.
  7. Include a unit test for the EXIF parser using one example image.

Tasks

Task 1 — set up the project (3 pts)

Task 2 — plan-mode prompt (5 pts)

Start Claude Code in plan mode (claude, then Shift+Tab) and prompt it for a step-by-step plan for the pipeline. Save the plan Claude produces verbatim into your prompts.md as appendix A.

Task 3 — iterate to a working pipeline (7 pts)

Approve the plan, let it execute, then iterate. Save every prompt you write in prompts.md, in order, with brief annotations describing what each prompt was trying to accomplish.

Test the pipeline on a small (~50-image) subset first. Only after it produces sensible output, run it on the full 2,000-image evaluation set.

Task 4 — sanity check (3 pts)

Compare your pipeline's species distribution to your Lab 3 + Lab 5 standalone results. They should match (within rounding). If they don't, debug.

Task 5 — reflection (2 pts)

In 200 words: what did Claude get right immediately? What did it get wrong, and how did you notice? Where did plan mode save you?

Grading note — what we look for in your prompts.md

Go-further

Add an MCP server (R or SQLite) and have Claude write a query that loads the tidy CSV into a database table.

Rubric

ComponentPoints
Project setup (CLAUDE.md + git init + plan)5
Working pipeline producing correct CSV6
Quality of saved prompts (plan-mode use, specificity, error-catching)5
Sanity-check vs Lab 3+52
Reflection2
Total20