Module 11 Β· Advanced Β· ~40 min

πŸ‘₯ Team Research & Collaboration

Share Claude Code setups across your lab, use Git for reproducible research, and standardise workflows so your whole team benefits from AI assistance.

Git + Claude Code: the basics

πŸ“–
What is Git and why do you need it with Claude Code? Git tracks every change to your files, like "track changes" in Word but for code. When Claude edits your files, Git means you can always undo any change. It's your safety net. Without it, Claude could accidentally overwrite work.

Here's a minimal Git workflow for research projects:

# 1. Initialise Git in your project (do this once)
git init
git add .
git commit -m "Initial project setup"

# 2. Before a Claude Code session
git status                    # See what's changed

# 3. After Claude makes changes you want to keep
git add -A
git commit -m "Claude: cleaned survey dataset"

# 4. If Claude made a mistake and you want to undo
git checkout -- analysis.do   # Undo changes to one file
git reset --hard HEAD         # Undo ALL changes since last commit
πŸ€–
Let Claude handle Git too You can ask Claude to commit its own changes: "After completing each task, commit the changes with a descriptive message." Claude will use Git automatically.

Sharing your Claude Code setup

Because everything is just files, sharing your Claude Code setup is automatic when you share your project via Git. Here's what gets shared:

File/FolderWhat it containsShare via Git?
CLAUDE.mdProject context for Claudeβœ… Yes β€” share this
.claude/commands/Custom skills/slash commandsβœ… Yes β€” share this
.claude/settings.jsonProject-level hooks and permissions⚠️ Yes, but remove secrets first
~/.claude/settings.jsonPersonal global settings❌ No β€” this is personal
~/.claude/CLAUDE.mdPersonal preferences❌ No β€” this is personal

Team CLAUDE.md best practice

# Add to your shared CLAUDE.md for team projects:

## Team Conventions
- All team members use Stata 17 or later
- Code review required before merging to main branch
- All analysis scripts must be runnable from scratch (no local paths)
- Use English for all code comments and variable names
- Ask before modifying files in data/raw/

## Contact
- PI: [name] β€” ask before major structural changes
- RA: [name] β€” handles data cleaning do files
- For questions about the analysis: see analysis/README.md

Reproducibility standards

> I want to make this project fully reproducible so anyone can
  replicate our results from scratch. Please:
  1. Check all file paths β€” flag any that are hardcoded to my computer
  2. Document all software versions needed (Stata 17, packages, etc.)
  3. Create a "README_replication.md" with step-by-step instructions
  4. Check that the analysis can run in the correct order with main.do
  5. Identify any data that can't be shared (PII) and suggest what to
     include instead (e.g., simulated data with same structure)

Working with RAs and co-authors

Briefing a new RA

> A new research assistant is joining our project tomorrow.
  They know Stata but haven't seen this project before.
  Create an onboarding document (docs/RA_onboarding.md) that:
  - Explains what the project is about (2 paragraphs)
  - Describes the folder structure and what's in each folder
  - Lists the 5 most important do files and what they do
  - Explains our coding conventions from CLAUDE.md
  - Gives them 3 starter tasks to get familiar with the data

Code review with Claude

> My RA wrote this data cleaning script (analysis/01_clean.do).
  Review it for:
  1. Correctness: will it produce the right output?
  2. Efficiency: are there unnecessary steps?
  3. Conventions: does it follow our CLAUDE.md style rules?
  4. Robustness: will it break if the data structure changes?
  Give specific, constructive feedback she can act on.
🎯

Module 11 Exercise: Set up a team-ready project

  1. If your project isn't in Git yet, initialise it: git init && git add . && git commit -m "Initial"
  2. Review your CLAUDE.md and add a "Team Conventions" section
  3. Ask Claude: "Create a .gitignore file appropriate for this project that excludes large data files, personal settings, and generated outputs"
  4. Ask Claude to create a replication README for your project
GitAny tool~30 min