Nathan A. Baune·workshop

Workshop

Spec it, log it, check it

Nathan A. Baune, PhD · first given 29 September 2026 · about 30 minutes

Using Claude Code in research without losing your own work.

Installing, context and compaction, its strengths and traps, writing with it, and how I work: spec first, log everything, hand off cleanly, check every step. Then CLAUDE.md, skills, connectors and git.

Everything here is yours to study and reuse afterwards: this page, its source, and the Claude Code skill that built it are at
gitlab.com/neurotrophy-git/presentations.

This page is also the handout. The code, asides and sources stay here. Press P for a full-screen view.

Claude Code

Claude running as an agent inside a folder on your computer. It reads your files, runs R, git and Python, edits code, and checks the results, asking permission along the way.

Chat Claude hands you code to paste. Claude Code opens the repo, makes the change, runs it, sees the error, and fixes it.

Getting started · docs

Install, log in, launch in a repo

PlatformCommand
macOS / Linux / WSLcurl -fsSL https://claude.ai/install.sh | bash
Windows PowerShellirm https://claude.ai/install.ps1 | iex
Homebrewbrew install --cask claude-code (no auto-update)
npmnpm install -g @anthropic-ai/claude-code (Node 22+)
cd ~/Research/perturbation-emg
claude          # first run opens a browser: Claude subscription or Console API key

The folder you launch from is the project. That choice decides which instructions it reads, as the next slides show.

Not a terminal person? VS Code and JetBrains extensions, the desktop app, or claude.ai/code in the browser.

The native installer updates itself. Homebrew and the Linux package managers don't.

How it remembers

Context fills up, then gets compacted

Everything it sees takes up its working memory: your CLAUDE.md files, every file it reads, every command output, the whole conversation. Near the limit, Claude Code automatically replaces the conversation with a summary.

Survives compaction

  • The project-root CLAUDE.md, re-read from disk
  • Auto memory
  • Skills you invoked
  • Every file on disk

Summarized or lost

  • Exact wording from the chat
  • Small decisions from an hour ago
  • "Remember to also fix X later"
  • The three things you changed before lunch

The lesson: anything that must persist goes in a file. CLAUDE.md holds rules, COMMIT_NOTES.md holds changes, and a notes file holds plans.

Every habit in the rest of this part exists because of compaction.

Strengths and traps · 1

Powerful for everyone, and it pulls toward the average

Frontier models like Claude are genuinely powerful whether you are learning to code or have done it for twenty years. The trap is in how they work.

  • It won't do something new. It skews toward whatever is most common in its training data.
  • Common is not the same as optimal, or what you wanted. It will probably run. It may not be right for your data, your device or your question.
  • Using it well means knowing what it is doing for you. If you can't tell whether its choice was good, you can't tell when it wasn't.
Kind of taskWhat to expect
Basically solved: a website, a standard lmer fit, a plotting script, file wranglingFast and mostly right. Review it, then move on.
Uncommon or never done before: a new perturbation analysis, a custom device, a method nobody has publishedYou steer the entire way. It fills in the pieces; you make every design decision.

Having to steer the entire way on novel work is the ideal anyway. That is the part that is actually your research.

Strengths and traps · 2

Language matters: Python is easy for it, R less so

Where it shines

Python, bash, JavaScript, SQL. These have huge amounts of public code, strong conventions, and stable standard libraries. Output is usually close to right on the first try.

Where it struggles

R. Conventions are looser, there are several ways to do everything (base, tidyverse, data.table), and there are thousands of packages it hasn't memorized well. Packages also change constantly, so its memory of an argument or default may be several versions out of date.

ggplot is the worst case. The code runs and the plot is still wrong: legend order, factor levels, facet scales, a deprecated argument (size became linewidth for lines in ggplot2 3.4). Expect several rounds, not one.

What helps

  • Tell it your versions: paste sessionInfo(), or pin them with renv.
  • Have it read the installed package's help (?emmeans) or NEWS instead of trusting memory.
  • Show it the plot. Paste a screenshot of what came out and describe what you wanted.
  • Put your style in CLAUDE.md: tidyverse or base, your ggplot theme, your colours.

Strengths and traps · 3

Make it teach you

It is an amazing tool for learning, if you ask it to be one.

  • Tell it to teach you as it works, at your level.
  • Tell it how to comment your code: why each step exists, not just what it does.
  • Read the code. Read the comments. Ask about anything you couldn't have written yourself.
  • Once you understand the output, you can judge it, and judging it is the whole job.
Teach me as you go. Comment this code for
someone who knows R but has never used mixed
models: explain why each step exists, not just
what it does. After each function, stop so I
can ask questions.

Strengths and traps · 4

Have it interview you, and make it show you the options

Interview first

Always ask it to ask you questions if anything is unclear or confusing. Better, have it literally interview you before it builds anything. The result is noticeably better.

Before writing anything, interview me. Ask one
question at a time about anything unclear or
undecided, until you could write the spec
without guessing.

Options, not answers

Have it search the web for how a thing is usually done and present the options. Discuss them. Look them up yourself.

Search the web for how people detect EMG onset.
Give me 3-4 approaches with trade-offs and
sources. Don't pick one. We'll decide together.

You make the decisions. It is there to write the code in a few seconds once you have.

This page started the same way: before building anything, Claude asked four questions about format, audience, code and demos.

Claude and writing · 1

Keep it far away from anything you want to be original

I am not a big fan of using AI for creative work, though that line isn't easy to draw.

  • If you want to express something original, keep it away from the writing. Nearly everything it generates sounds the same, and it isn't to my liking at all.
  • This is the pull toward the average from earlier, applied to prose: the most common phrasing, the most common structure, the most common rhythm.
  • Readers notice. Once a paragraph sounds generated, they stop trusting that the thinking behind it is yours.

Claude and writing · 2

In scientific writing, use it as an editor, not an author

Where it helps

  • Editing: a very effective second reader for clarity, consistency and flow.
  • Layout: section order, where a table beats a paragraph, when to use bullets.
  • Refactoring: splitting a tangled paragraph, moving a point to where it belongs.
  • Checking: does the methods section match what the analysis code actually does?

Ask for suggestions, not replacements

Edit this section for clarity only. Don't add
claims or change what the results say. List
each suggested change with the original, the
revision and one line on why. I'll decide.

Don't use its writing wholesale unless you are ready to edit all of it and take full responsibility for the content. Your name is on it.

Claude and writing · 3

If it rewrites for you, teach it your voice first

  1. Collect examples of your own writing that you approve of. Many of them, across registers: papers, emails, abstracts.
  2. Have it study them and write a skill that captures your voice, and then edit that skill yourself.
  3. List exactly what you never want to see: the LLM-isms. The skill should name them. Your list is personal: I love em dashes and colons, especially for reveals, so mine are allowed, used on purpose because modern readers can read them as machine-written.
  4. Keep adding every new tic you catch. The list only gets better.
---
name: my-voice
description: Use when drafting or rewriting
  prose that will go out under my name.
---
Read examples/ (writing I approve of) first.

Never:
- "It's not X, it's Y." / "not just X, but Y"
- delve, tapestry, landscape, crucial,
  robust, leverage, seamless
- rhetorical questions as transitions
- lists of three for rhythm
- a closing line restating the paragraph

On purpose, sparingly:
- em dashes and colon reveals. They're mine,
  but readers now take them as AI tells.

Always: short declarative sentences, the
number instead of the adjective, active voice.

I keep mine as a style guide with a list of banned words and AI-cadence tells, plus a short checklist Claude runs before writing anything in my voice.

How I work

Spec it, log it, check it

This is how I build anything, with or without AI. It matters more with AI, because the agent forgets, drifts, and never understands what you meant unless it is written down.

How I work · 1

Spec. Always spec.

Before building anything, write down what you intend and how you plan to do it. Claude makes this easier, not optional.

  • It can write the spec for you as a .md file from a messy description, then ask you what is missing.
  • It can draw it: flow diagrams, figures, block diagrams. So can you.
  • Sketches count. I draw on my iPad or in my notebook, take a photo, drop it into Claude Code, and say "document this." The sketch and its write-up both go in the repo.
  • A spec is a living record. When a decision changes, add a dated revision with the reason. Don't silently rewrite it.
A dated notebook page: a pencil sketch of the POISE perturbation device housing, with its dimensions in millimetres, the electronics cavity, 4 mm mounting holes, and a note that the recess is 8 mm deep with the Hall-effect sensor wires running down a small channel.
From my notebook, 29 September 2026: the perturbation device housing. A photo like this is a fine start for a spec.
# Spec: EMG onset pipeline v2
Started 2026-09-28

## Why
## What done looks like
## Design
  sketch: docs/sketches/2026-09-28-onset-flow.jpg
## Decisions (dated, with reasons)
## Open questions
## Out of scope

## Revisions
- 2026-10-02: threshold moved to 3 SD;
  2 SD caught movement artifact.

How I work · 2

Log every last scrap, and date everything

Git commits say what changed. They don't say what you tried, why you gave up on it, or the idea you had on the walk home. Keep a development log on top of git. Tell Claude to add to it whenever you have an idea, make a decision or hit a dead end, and add to it yourself.

CLAUDE.md ← this project: how it works, where things live COMMIT_NOTES.md ← what changed, per commit docs/ devlog/2026-09.md ← dated: ideas, decisions, dead ends specs/onset-pipeline.md handoff.md ← where things stand right now hardware/bom.md, wiring.md sketches/2026-09-28-onset-flow.jpg results/ v1/ v2/ v3/ ITERATIONS.md ← why each version exists
  • Many small files, not one giant one. Split by purpose and keep the tree clean. A 3,000-line notes file is as unreadable to Claude as it is to you.
  • The master CLAUDE.md, at the top of the pyramid, says what you like: dev log or not, commit notes, bill of materials and wiring diagrams, which tools you use, which parts you do yourself, and what it should work on first.
  • Date everything. "Changed the threshold" is useless in a year. "2026-10-02: 3 SD, because 2 SD caught movement artifact" is not.

I keep all my notes in a database any Claude session can search, so it can find what I'm talking about. You don't need to go that far. Well-organized .md files get you most of the way.

How I work · 3

Don't try to finish in one conversation

Context runs out and compaction loses detail. Plan for a fresh conversation to pick the work up, and make that easy.

Keep a handoff doc

  • Where things stand, what is next, and what is broken.
  • Which files matter and which decisions are pending.
  • Update it at the end of every session, or have Claude do it.

With the spec, dev log and handoff in place, a new conversation is useful within minutes, not an hour of re-explaining.

Starting a fresh session

Read CLAUDE.md, docs/handoff.md and the last
two entries in docs/devlog/. Tell me where we
are and what you think is next. Don't change
anything yet.

This is for you as much as for the AI. You, years from now, reopening a project for a revision or a thesis chapter, are the reader who needs it most.

How I work · 4

Double-check everything. Period.

It will make mistakes. That is guaranteed.

  • It will drift from your plan, quietly, a little at a time.
  • It will misunderstand you. It doesn't actually understand anything; it produces what is likely to fit.
  • It is better in some languages than others. Strongest in Python and bash; shakier in R, niche toolboxes and hardware code. See Strengths and traps.
  • Don't hand it full autonomy unless you are confident the task is trivial for it. Read its questions and permission prompts, and vet each step as it happens.
  • Check the outputs, not just the code. Row counts, a plot, a number you can verify by hand.

Auto mode is great for a well-specified, low-risk task. For analysis code that ends up in a paper, sit with it.

How I work · 5

Git is not the whole record

Git change tracking is excellent for code that evolves. But when a new wave of analysis results arrives, or the method shifts in a big way, keep an explicit record too.

If you only overwrite

The history lives in git, and Claude won't read it unless told. You have to say "check git log and the diffs for how this changed," every time.

If you keep versions

Folders like results/v2/ and v3/ are visible at a glance. Better still, add a short .md explaining the thinking behind each iteration.

It WILL repeat mistakes that aren't logged somewhere it looks. A dead end recorded in the dev log is a dead end it won't walk down again.

How I work · 6

Teach it where to look

It won't read everything. It reads CLAUDE.md, then reads further depending on the task, and it can skip the one document that mattered.

## Where to look (read before acting)
- Before changing the model: docs/specs/model.md,
  then search docs/devlog/ for "model".
- Before touching exclusions: analysis/README.md.
- Before proposing a fix: search docs/devlog/ for
  the error text. We may have tried it already.
- When results change: compare against
  results/ITERATIONS.md.
- Unsure whether a doc exists? List docs/ and
  grep. Don't assume.
  • Write CLAUDE.md as a map: for each kind of task, which files to read first.
  • Tell it how to search: which folders, which terms, and that searching comes before building.
  • Think about where it will look for something, and put the information there.
  • When it misses something, don't just point it out. Fix the map so the next session finds it.

How I work · 7 · an extra

Test the pipeline on data where you know the answer

I now generate simulated data to test analysis pipelines and software before trusting them with real data. You know the ground truth, so you can tell a bug in the code or flow logic from a real problem in your data that you missed.

# Parameter recovery: does the pipeline return what we put in?
set.seed(42)
truth <- list(effect_ms = 12, sd_subject = 25, sd_slope = 6, sd_trial = 15)
sim   <- simulate_trials(n_subj = 20, n_trials = 40, truth)  # your simulator
res   <- run_pipeline(sim)                                   # the real pipeline, unchanged
stopifnot(abs(res$effect_ms - truth$effect_ms) < 3)
log_result("recovery", truth, res)                           # keep every run

The simulator from your power analysis (Part 1) can serve here too.

  • Doesn't recover the truth? The bug is in the code, not your participants.
  • Recovers it, but real results look odd? Now look hard at the data.
  • Hunt the niche bugs yourself. A trial shifted by one sample, an exclusion applied in the wrong order, a factor level silently dropped. If you overlooked it, the AI is even more likely to.

Where the AI helps

It is a personal assistant here, and a very good one: writing simulators and test scripts, running them over and over, and logging every result.

Larger software

Unit tests are critical. Every function that transforms data gets a test with a known answer (testthat in R, pytest in Python). Have Claude run them after every change and before it says it's done.

How I work · 8

Let agents check each other

Ask Claude to use subagents to double- or triple-check its own work. A reviewer with fresh context catches what the agent that wrote the code talked itself into.

One manager, many workers

A stronger model acting as project manager over a swarm of simpler, cheaper models is often more powerful, and it uses far less of your subscription limit than running everything on the biggest model. The manager plans and judges; the workers sweep files, run tests and check references.

Claude Code can set this up on its own if you ask. When the time comes, you can micromanage it as much as you like: which model each agent uses, which tools it may touch, and exactly what it checks.

When you finish, spawn a reviewer subagent that
hasn't seen this conversation. Have it check the
changes against docs/specs/ and list problems.
Use cheaper models for the file sweeps.

.claude/agents/pipeline-checker.md

---
name: pipeline-checker
description: Independently checks analysis code
  against the spec after any change to analysis/.
tools: Read, Grep, Glob, Bash
model: haiku
---
Read docs/specs/ and the changed files. Edit nothing.
Report spec mismatches, untested paths, and rows
dropped silently.

Agents checking agents catch different mistakes, not all of them. This page is an example: a subagent checked the Claude Code facts, and the main session caught three errors in its report. You are still the last check.

Commands you'll actually use

Sessions, context, models

CommandWhat it does
/clearFresh conversation. Use it between unrelated tasks.
/compact [focus]Summarize now, e.g. /compact keep the model-selection decisions
/contextWhat is using context, and which CLAUDE.md files loaded
/resume · claude -c · claude -rPick up a past session, the most recent one, or open the picker
/rename · claude -n nameName a session so you can find it later
/modelOpus for hard reasoning, Sonnet for everyday work, Haiku for quick cheap jobs
/rewind · Esc EscRoll the conversation and code back to a checkpoint
Shift+TabCycle permission modes, including plan mode
/init · /memoryGenerate a starter CLAUDE.md; open and edit memory files
/mcp · /agents · /hooks · /configConnectors, subagents, hooks, settings

Typing shortcuts: @analysis/fit.R pulls a file into the prompt. ! Rscript fit.R runs it yourself, with the output landing in the chat. Paste screenshots of odd plots.

Run /context in a session to see exactly which CLAUDE.md files loaded.

Safety · docs

Permission modes, and fencing off data

ModeRuns without askingUse for
Manual (default)Reads onlySensitive work; building trust
acceptEditsReads, file edits, basic file commandsIterating on code you review
planReads; proposes, doesn't editThinking before doing
autoEverything, with a background safety classifierLong tasks; the default on newer versions
bypassPermissionsEverything, no checksThrowaway containers only

Keep raw participant files unreadable even in auto mode, in .claude/settings.json:

{
  "permissions": {
    "deny": ["Read(./data/raw/**)", "Read(./**/*.edf)"]
  }
}

Whatever it reads is sent to the model. That's the reason for the deny rule.

CLAUDE.md · the pyramid

One master file sits at the peak

~/.claude/CLAUDE.md is the master. It loads in every session, in every folder, so it holds how you work everywhere. Each level below adds detail for a narrower scope.

~/.claude/CLAUDE.md The master: how you work, everywhere ~/Research/CLAUDE.md One domain: lab-wide rules repo/CLAUDE.md One project: design, decisions, layout subfolders · docs/ · skills Details, loaded only when needed
The top three load when you launch a session inside a repo. The base loads on demand, when Claude opens a file there or a skill matches the task.
  • The peak is short and general, and the base is long and specific. A rule belongs at the highest level where it is true everywhere below it.
  • Put nothing twice. If a rule appears in two files, it will eventually disagree with itself.
  • Procedures become skills, not CLAUDE.md sections, so they load only when the task needs them.

CLAUDE.md · docs

Broad rules up high, project detail in each repo

~/.claude/CLAUDE.md ← me, everywhere ~/Research/ CLAUDE.md ← lab-wide rules perturbation-emg/ ← its own git repo CLAUDE.md ← this study COMMIT_NOTES.md analysis/CLAUDE.md ← loads on demand kinarm-suite/ CLAUDE.md COMMIT_NOTES.md
  • At launch: CLAUDE.md in your folder and every folder above it, plus your personal file, stacked from general to specific.
  • On demand: subfolder CLAUDE.md files load when Claude first reads a file there.
  • @README.md inside a CLAUDE.md imports another file.
  • CLAUDE.local.md holds personal, gitignored notes.
  • Keep each file under about 200 lines.

Launch inside the repo, not at the root. cd ~/Research/perturbation-emg && claude loads your personal, lab-wide and study files together.

This is my actual setup. The root file holds what Claude and I have agreed on; each repo file holds that project's context.

CLAUDE.md · the root file

~/Research/CLAUDE.md: rules we settled on once

# Research workspace

Each subfolder is its own git repo. Work inside one repo at a time.

## Before working in a repo
- Read that repo's CLAUDE.md and README first.

## Keep the docs alive (mandatory)
- If you change something a repo's CLAUDE.md or README describes (variables,
  exclusion rules, model structure, file layout), update that file in the
  same session. Stale docs are worse than none.
- When I correct you twice on the same thing, propose a line for CLAUDE.md.

## Git
- Commit only when I ask. Never push without asking. Never force-push.
- Log each change in COMMIT_NOTES.md; build commit messages from it.

## Data
- Never read data/raw/. Work on de-identified exports in data/derived/.
- Never commit data files; check .gitignore before any git add.

## R
- lme4 + lmerTest + emmeans. Set a seed for anything random.
- Print n per condition after every filtering step.

The "keep the docs alive" rule is what keeps the repo files current.

CLAUDE.md · the repo file

Give it the context you'd give a new RA

# Perturbation EMG study

Design: 24 participants x 3 directions x 2 speeds, ~40 trials each.
Outcome: onset_ms. cond = {fwd, back, lat}.
Trial exclusion: >20% marker dropout
  (was 10% until 2026-09-28, see COMMIT_NOTES).

## Model decisions
- onset_ms ~ cond * speed_c + (1 + cond | subject)
- Speed slope dropped from random effects:
  singular fit (2026-09-10).

## Layout
- analysis/fit_models.R -> results/models/*.rds
- figures/ is regenerated; never hand-edit.

Keeping it current

  1. End a chunk of work with "update the repo CLAUDE.md with anything we decided."
  2. Record decisions and why. That is what you forget and what reviewers ask about.
  3. Every few weeks, have Claude audit the files for stale or conflicting rules.
  4. Claude also keeps its own auto memory of your corrections. Browse it with /memory. CLAUDE.md is yours; auto memory is its notebook.

Tie back to Part 1: the "model decisions" block is exactly what a methods section needs.

Git

COMMIT_NOTES.md: a log that survives compaction

Claude appends a line as each change lands. At commit time, the message is built from the file, not from what Claude remembers of a long conversation.

The file

# COMMIT_NOTES

- add Satterthwaite df to stats export in
  fit_models.R (2026-09-28T14:10-04:00)
- fix trial exclusion: >20% dropout, was 10%
  (2026-09-28T14:42-04:00)
- new fig_emg_onsets.R: per-subject lines +
  emmeans CI (2026-09-28T15:05-04:00)

The rule in CLAUDE.md

## COMMIT_NOTES.md
- After each meaningful change, append one
  line: what and why, plus an ISO timestamp.
- Skip reads, searches, failed attempts.
- On "commit": build the message from
  COMMIT_NOTES.md, show me, commit, clear it.
  • Claude runs git through the shell like you would. Ask to see the diff before commits until you trust it.
  • Write down when to commit and push so it doesn't decide for you.
  • .gitignore raw data and anything under an IRB. It will happily git add . whatever is there.
  • Branch before experiments. Git is the undo button for everything Claude does.

After a two-hour session with two compactions, the commit message still lists every fix, because the file never forgot.

Skills · docs

Package a procedure once, reuse it forever

CLAUDE.md is what Claude always knows. A skill is a procedure it loads only when needed.

  • A skill is a folder with a SKILL.md: a one-line description plus instructions, optionally with scripts and reference files beside it.
  • ~/.claude/skills/<name>/ is yours, everywhere. .claude/skills/<name>/ in a repo is shared with the lab through git.
  • Claude picks one when your request matches its description, or you type /<name>.
  • disable-model-invocation: true makes it manual-only, which is right for anything with side effects.
  • A line like !`git diff HEAD` inserts live output when the skill loads.
  • Older .claude/commands/ files still work; skills replace them. Plugins (/plugin) bundle skills, hooks and connectors to share a whole setup.

Easiest way to make one: after doing something twice by hand, say "turn what we just did into a skill", then edit what it writes.

Only the description sits in context until the skill is used, so skills are almost free.

Skills · two examples

A mixed-model reviewer, and a commit button

.claude/skills/lmm-check/SKILL.md

---
name: lmm-check
description: Review an lme4/lmerTest mixed
  model before results are reported. Use when
  the user fits a mixed model or is about to
  report lmer results.
---

Check and report each item:
1. Active contrast coding; what each summary()
   coefficient means (which reference level).
2. Numeric predictors centred?
3. Within-subject factors lacking a random
   slope, and why.
4. isSingular(); which variance is at 0.
5. df method and number of participants.
6. Key tests rewritten as emmeans contrasts
   with a multiplicity correction.
7. Suggest per-participant lines + emmeans CI.

Do not change the model. List concerns; I decide.

.claude/skills/commit/SKILL.md

---
name: commit
description: Commit staged work using
  COMMIT_NOTES.md as the message source.
disable-model-invocation: true
---

## Pending notes
!`cat COMMIT_NOTES.md`

## Status
!`git status --short`

1. Draft a message: one summary line, then
   the notes above as bullets.
2. Show me the message and files. Wait.
3. Commit, then reset COMMIT_NOTES.md.
4. Do not push.

The left one is Part 1 turned into a checklist Claude runs every time someone fits a model.

Connectors · docs

MCP connectors reach outside your folder

  • If you log in with a claude.ai account, connectors enabled there (PubMed, bioRxiv, Google Drive…) work in Claude Code too. Check with /mcp.
  • Scopes: local (default, you in this project), project (.mcp.json committed for the lab), user (you, everywhere).
  • Research use: literature search through PubMed returns real, linkable records instead of remembered ones.
  • Every connector's output lands in context. Enable only what you use.
claude mcp add --transport http github https://api.githubcopilot.com/mcp/   # remote server
claude mcp add --transport stdio mytool -- npx -y some-mcp-server          # local server
claude mcp add --scope project ...                                         # shared via .mcp.json

Also worth knowing

  • Hooks: shell commands that fire at set moments, every time. Example: a desktop notification when Claude is waiting on you.
  • Subagents: helpers with separate context. "Use a subagent to find where all 24 repos compute onset latency" keeps the search out of your chat.
  • GitHub: it uses gh directly; /install-github-app enables @claude on PRs. claude --worktree runs parallel sessions safely.

Skills, MCP servers, connectors · what MCP is

A skill is know-how. An MCP server is hands.

SkillMCP serverConnector
What it isA folder of instructions, and optionally scripts, that Claude loads when your request matches itA small program that offers Claude named tools, each with typed inputs and a descriptionThe name Claude's apps use for an MCP server you've added, with its sign-in
Where it runsInside Claude's session: your computer in Claude Code, a sandbox in Claude on the webWherever it's installed: your own computer, or a hosted serverHosted servers in any Claude app; servers on your computer only in Claude Code and the desktop app
RulesIt can ask Claude to follow themEnforced in code: a tool can't do what it wasn't written to doWhatever its server enforces
Good forProcedures, checklists, house styleData, instruments and software Claude can't otherwise reachReady-made services: PubMed, Google Drive, GitHub

Use both. The skill says when and why. The server does the work.

MCP · a worked example · repo

The lab's own tools, as an MCP server

neuromechanics-lab-mcp lets Claude use three tools the lab already had. They run on your computer, and the recordings never leave it.

What Claude can do with it

  • BIDS-SQL: ask about a study database. Which subjects have the balance task, who is missing processed output, which QC checks failed, which channels were bad.
  • PRE-Sync: the delay between sync channels in one recording, the lag between two recordings, or the full alignment report.
  • Kinarm converter: convert a .kinarm file and say what's in it.

Rules written into the code

  • Databases open read-only.
  • Summaries, never raw samples.
  • No dates and no free-text notes. Ages and sex only for groups of five or more.
  • New files only, never an overwrite, and only in folders you list.
  • Every answer says what it left out, and every error says what went wrong.

Install guide: docs/install.md (macOS, about ten minutes). Each tool keeps its own repo; the server only wraps them.

MCP · what a tool looks like

A tool is an ordinary function with a description

One of its fifteen tools

@tool(READ)
def bids_list_tasks(database: str,
                    dataset_id: int) -> dict:
    """Tasks in a dataset, with how many
    subjects and raw files each has."""
    with _db(database) as c:
        return bids.list_tasks(c, dataset_id)
  • The docstring is what Claude reads to decide when to use it.
  • The type hints become the inputs Claude has to supply.
  • The body is plain Python calling the library you already have.

Adding it to the Claude desktop app

{
  "mcpServers": {
    "nm-lab": {
      "command": "…/bin/neuromechanics-lab-mcp"
    }
  }
}

Use the full path: which neuromechanics-lab-mcp prints it.

In Claude Code

claude mcp add --transport stdio \
  nm-lab -- neuromechanics-lab-mcp

Then just ask: "Which subjects in the balance study are missing processed EEG?" Claude picks the tool, fills in the inputs, and answers from the database.

Live example

This page was made with Claude Code the day before the meeting

One session, starting from a single rambling paragraph of instructions. Part of it asked Claude to summarize how I work with Claude Code across more projects than I can keep straight in my head. Everything else arrived as follow-up messages while it worked. Here is what actually happened.

  1. It asked before it built. Four quick questions: output format, how stats-fluent the room is, whether to include R code, and whether to plan a live demo.
  2. It worked in parallel. A subagent checked Claude Code facts against the official docs while the main session drafted the mixed-models talking points into a shared doc.
  3. It caught its own helper's mistakes. Checking the docs directly overturned three of the subagent's claims: parent-folder CLAUDE.md loading, the import syntax, and what survives compaction. Verifying takes minutes and it matters.
  4. It checked citations with a connector. The two neuroscience papers were matched to real PubMed records instead of trusted from memory.
  5. It took changes mid-stream. The trial-level data, degrees-of-freedom and difference-score section, and the power-simulation repo link, came in as messages while it was working.
  6. It borrowed a design system. It read the fonts and layout from my personal website's repo, then sampled the exact colours from the lab logo file and embedded the logo itself.
  7. It drew the figures from simulated data and published this page as a private link I can share.

What it did not do: decide what to teach. The topics, the emphasis, and the "lean away from difference scores" stance are mine. Claude did the drafting, checking, and building around them.

You are looking at the result: this page.

Best practices

Treat it like a fast, confident new RA

  1. Plan before it types. For anything past a one-liner, ask for a plan and tell it to ask you questions. Fixing a plan is cheaper than fixing code.
  2. Give it a way to check itself. Have it run the script and read the output. Ask for sanity prints: n per condition, trials per participant, rows dropped and why.
  3. Small steps, review the diff, commit.
  4. One task per session. /clear between unrelated jobs so stale context doesn't leak.
  5. When it repeats a mistake, write the rule down in the right CLAUDE.md. That is how the setup improves.

Good output when the instructions are clear and someone checks the work. Same as any RA.

Cautions

You still own the model, the citations, and the data

Stats

  • It writes plausible lmer code instantly, and plausible is the danger. Make it justify every term and random effect.
  • Watch for quiet failures: NA rows dropped, numbers read as factors, the wrong grouping variable, a default contrast you didn't choose.
  • Cross-check one result by hand before trusting the pipeline.

Citations and data

  • Never trust a reference produced from memory. Pull records through a literature connector, then open the paper.
  • Whatever Claude reads goes to the model. Keep identifiable participant data out of reach: use de-identified exports and deny rules.
  • Check Emory's current AI guidance and your IRB protocol before pointing it at human-subjects data. That is a policy question, not a technical one.