Lab 8 · Build a Camera-Trap Pipeline Using Claude Code
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:
- Walk a directory recursively, reading EXIF timestamps.
- Run MegaDetector for animal localization.
- For every animal crop, run your Lab 5 species classifier.
- Write the tidy CSV.
- Skip images that have already been processed (resumable).
- Be runnable from a one-line command:
python pipeline.py --input X --output Y. - Include a unit test for the EXIF parser using one example image.
Tasks
Task 1 — set up the project (3 pts)
- Create a new empty folder
cc_pipeline/. - Write a
CLAUDE.mddescribing the task, the data layout, the conventions you want followed (see the CLAUDE.md template), and where the Lab 5 classifier weights live. git init && git add -A && git commit -m "before claude".
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
- Specific success criteria in your asks (e.g., "exit with non-zero on any EXIF parsing failure" beats "handle errors").
- Catching mistakes: places where you noticed Claude was about to do something wrong and steered it.
- Use of
CLAUDE.md: did you keep it updated as the project grew? - Restraint: not letting Claude pile on features that weren't asked for.
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
| Component | Points |
|---|---|
| Project setup (CLAUDE.md + git init + plan) | 5 |
| Working pipeline producing correct CSV | 6 |
| Quality of saved prompts (plan-mode use, specificity, error-catching) | 5 |
| Sanity-check vs Lab 3+5 | 2 |
| Reflection | 2 |
| Total | 20 |