A practical guide for scientists building pipelines, CLIs, APIs and data tools.
From everyday AI prompting to structured data science applications — without a GUI.
Dr Raminderpal Singh · raminderpal@hitchhikersai.org · raminderpalsingh.com · 20/15 Visioneers
Claude Code is an agentic command-line tool from Anthropic that lets you give Claude direct access to your terminal, files, and project directory. Instead of copying code snippets back and forth from a chat window, Claude Code reads your codebase, writes files, runs commands, and iterates on errors — all from your terminal.
Think of it this way: the Claude app (claude.ai) is where you have a conversation and plan your approach. Claude Code is where Claude actually builds the thing — it has its hands on the keyboard.
The workflow: You use the Claude app to think through requirements and create a structured specification. Then you give that specification to Claude Code, which generates the project, writes the files, installs dependencies, and runs tests — all in your terminal.
Phase 1 of the AI Drug Dev methodology has two paths depending on what you're building. The tool choice follows from the type of application, not a personal preference.
Cursor gives you live previews, inline code editing, and visual feedback loops. Best when the output is a screen.
Claude Code gives you terminal-native power. Best when the output is data, files, or a running service — not a screen.
Honest assessment: Claude Code is more powerful than Cursor for non-interactive work, but it's also more raw. There's no GUI, no undo button, and the AI has real access to your filesystem. You need to understand what it's doing. This guide will show you how.
Non-interactive applications are programs that run without a graphical user interface. They process input, do computation, and produce output — but nobody sits in front of them clicking buttons. They are the backbone of scientific computing.
Read raw experimental data, clean it, compute statistics, produce formatted output. E.g., plate reader CSV → IC50 table.
Command-line utilities your team runs from terminal. E.g., annotate-variants --input data.vcf --output report.tsv
HTTP endpoints that accept requests and return results. E.g., a FastAPI service that computes molecular descriptors on demand.
Extract-Transform-Load workflows. E.g., pull data from an instrument, standardise formats, load into a database.
Sequence analysis, BLAST wrappers, FASTA/FASTQ processing, phylogenetic tree construction, variant calling pipelines.
Scripts that run on schedule, generate summary reports from data, and email or save results. No human interaction required.
Building non-interactive apps uses three tools in sequence. Each has a specific role. Do not skip or merge the steps.
Key principle: The Claude app is for thinking. Claude Code is for doing. Do not use Claude Code to plan. Do not use the Claude app to write code. Separating these roles produces better results from both.
Before you start, you need a few things installed on your machine. This guide assumes macOS, but Claude Code also works on Linux.
Claude Code is an npm package. Install Node.js from nodejs.org (LTS version). Verify: node --version
Your applications run Python. Install via python.org or Homebrew: brew install python@3.12
Fast Python package manager. Install: curl -LsSf https://astral.sh/uv/install.sh | sh
You need an active Claude subscription (Pro, Team, or Enterprise) to use Claude Code. It uses your Anthropic account directly.
# Install Claude Code globally npm install -g @anthropic-ai/claude-code # Verify installation claude --version # Authenticate (opens browser) claude auth
First time: Running claude auth opens your browser and asks you to sign in to your Anthropic account. Once authenticated, Claude Code stores your credentials locally. You won't need to do this again.
# Create a new project directory mkdir my-pipeline && cd my-pipeline # Initialise a Python project with uv uv init # Initialise git (your undo button) git init # Start Claude Code in this directory claude
When you run claude, you enter an interactive session. Claude can now see all files in your project directory. You type natural language instructions, and Claude reads files, writes code, runs commands, and iterates.
Filesystem access: Claude Code has real read/write access to your project directory. It can create, edit, and delete files. It can also run terminal commands. Always work in a dedicated project folder, not your home directory.
my-pipeline/ ├── src/ # Source code │ ├── __init__.py │ ├── main.py # Entry point │ ├── pipeline.py # Core logic │ └── utils.py # Helper functions ├── tests/ # Test files │ ├── test_pipeline.py │ └── test_utils.py ├── data/ # Input data (gitignored) ├── output/ # Generated results (gitignored) ├── .env # API keys (never commit) ├── .gitignore ├── pyproject.toml # Dependencies (managed by uv) ├── uv.lock # Lock file (auto-generated) ├── CLAUDE.md # Instructions for Claude Code └── README.md
CLAUDE.md is a special file that Claude Code reads automatically when it starts in a directory. It's like a persistent system prompt for your project. Use it to tell Claude about your project's conventions, constraints, and expectations.
# Project: Plate Reader Analysis Pipeline ## Context This is a Python data pipeline that processes plate reader CSV exports and computes IC50 values using 4-parameter logistic curve fitting. ## Conventions - Python 3.12, managed with uv - Use pathlib for all file paths - Use pandas for tabular data - Use scipy.optimize.curve_fit for fitting - All functions must have type hints and docstrings - Tests use pytest ## Commands - Run: uv run python -m src.main - Test: uv run pytest - Lint: uv run ruff check src/ ## Do NOT - Do not use global variables - Do not hardcode file paths - Do not suppress exceptions silently
Why this matters: Without CLAUDE.md, Claude Code makes assumptions. With it, Claude follows your project's rules from the first command. Write it once, benefit every session.
Every non-interactive app follows the same workflow. Phase A happens in the Claude app (claude.ai). Phase B happens in Claude Code (your terminal). Do not combine them.
Open the Claude app and have a conversation. Your goal is to produce a structured specification that you will paste into Claude Code. The specification must include:
Use your scientific vocabulary. Don't try to translate into code terminology. Claude understands biology, chemistry, and data science language.
Example prompt: "I need a Python command-line tool that takes a CSV of plate reader absorbance values (96-well format, columns A01–H12, rows are timepoints), normalises to the control wells in column 12, fits a 4-parameter logistic curve per compound, and outputs an IC50 summary table as CSV."
Give Claude concrete examples of what goes in and what should come out. Include edge cases: what happens with missing data? What happens with a flat curve that can't be fit?
Golden Rule: If you do not provide test inputs and expected outputs, the AI will write tests that confirm its own implementation rather than independently specifying behaviour. A defect in the reasoning produces a matching defect in the tests. Everything passes. The bug ships.
Your prompt should be: "Generate a complete specification for this tool that I can give to Claude Code. Include: project structure, module descriptions, function signatures with types, test cases with concrete inputs and expected outputs, and any dependencies."
Claude will produce a structured document. Review it carefully. Correct any domain errors. This is your specification — the quality of the output depends entirely on the quality of this document.
Now switch to your terminal. Start Claude Code in your project directory and paste the specification.
Claude Code will read the spec, create the project structure, write all files, install dependencies, and run the tests. Watch the terminal output — Claude will tell you what it's doing at each step.
Here is the specification for this project. Implement it fully. Write tests first, then implement the code to pass them. Run the tests after implementation and fix any failures. [paste your specification from Claude app here]
Claude Code doesn't just generate code and stop. It runs it, reads the error output, and fixes issues. This iterative loop is the core advantage. A typical build involves 3–8 iterations before all tests pass.
When to intervene: If Claude is going in circles on the same error for more than 2 attempts, stop it and provide guidance. Say: "The issue is [X]. Try [Y] instead." Your domain knowledge is what makes this work.
Synthetic test data passing is necessary but not sufficient. Run the tool on real data from your lab and verify the output against known results. If something is wrong, describe the issue to Claude Code: "The IC50 for compound X should be ~3.2 μM but the tool reports 0.32 μM. The unit conversion is likely wrong."
Vibe coding is iterative. You may go through the spec → build → test loop multiple times. Each iteration refines the tool. When the prototype handles your real use cases correctly, Phase 1 is complete.
Next step: When you're ready to move from prototype to production, take the codebase into Phase 2: Productizing, which applies test-first hardening, enforcement mechanisms, and a 30-check production readiness assessment.
This exercise walks you through building a simple but complete data pipeline using the Claude app + Claude Code workflow. You will build a tool that reads experimental CSV data, computes summary statistics, and produces a formatted output file.
Build a command-line Python tool called experiment-summary that:
Input: A CSV file with columns: sample_id, condition, replicate, measurement
Processing: Group by condition, compute mean and standard deviation per condition, flag any condition where CV (coefficient of variation) exceeds 20%
Output: A summary CSV with columns: condition, n, mean, std, cv_percent, flag
Open the Claude app and use this prompt as a starting point:
I need a Python command-line tool called "experiment-summary". ## What it does Reads a CSV with columns: sample_id, condition, replicate, measurement. Groups by condition. Computes mean, std, and coefficient of variation (CV%) per condition. Flags any condition where CV% > 20%. Outputs a summary CSV. ## Test input (paste this as a CSV) sample_id,condition,replicate,measurement S01,control,1,5.2 S02,control,2,5.4 S03,control,3,5.1 S04,drug_A,1,8.7 S05,drug_A,2,9.1 S06,drug_A,3,8.5 S07,drug_B,1,3.2 S08,drug_B,2,7.8 S09,drug_B,3,5.1 ## Expected output condition,n,mean,std,cv_percent,flag control,3,5.233,0.153,2.92, drug_A,3,8.767,0.306,3.49, drug_B,3,5.367,2.301,42.88,HIGH_CV ## Requirements - Python 3.12, managed with uv - Use pandas for data handling - Use argparse for CLI: experiment-summary --input data.csv --output summary.csv - Round all numbers to 3 decimal places - Include proper error handling for missing files and bad CSV formats - Include pytest tests with the test data above Generate a complete specification I can paste into Claude Code.
Claude will produce a structured specification. Before pasting it into Claude Code, verify:
# Create project mkdir experiment-summary && cd experiment-summary uv init git init # Start Claude Code claude # Then paste your specification and say: # "Implement this specification. Write tests first, then code. Run tests."
After Claude Code finishes, run the tool yourself:
# Save test data to a file cat > test_data.csv <<EOF sample_id,condition,replicate,measurement S01,control,1,5.2 S02,control,2,5.4 S03,control,3,5.1 S04,drug_A,1,8.7 S05,drug_A,2,9.1 S06,drug_A,3,8.5 S07,drug_B,1,3.2 S08,drug_B,2,7.8 S09,drug_B,3,5.1 EOF # Run the tool uv run python -m src.main --input test_data.csv --output summary.csv # Check the output cat summary.csv
Compare the output against your expected results. If drug_B shows flag=HIGH_CV and the numbers match to 3 decimal places, your prototype works.
Congratulations. You've built a working data pipeline using the Claude app + Claude Code workflow. The entire process — specification, implementation, testing — should take 15–30 minutes.
These rules come from real experience teaching scientists to vibe code. They are not theoretical. Violating any of them will cost you time.
This is the single most important rule. If you remember nothing else from this guide, remember this. When an AI writes both the code and the tests, any reasoning error produces a matching error in both. The test passes, but the code is wrong.
The fix: you provide the expected outputs. You know what the correct answer is because you understand the science. The AI does not.
When you ask Claude Code to both plan and implement in the same session, it shortcuts the planning. It jumps straight to writing code. The result is code that works for the obvious case but misses edge cases, error handling, and structure.
A 10-minute conversation in the Claude app saves 30 minutes of debugging in Claude Code.
Without CLAUDE.md, you'll repeat the same instructions every time you start Claude Code: "use type hints", "use pathlib", "run tests with pytest". CLAUDE.md eliminates this repetition and ensures consistency across sessions.
Claude Code writes and deletes files. Sometimes it takes a wrong turn. With git init and regular commits, you can always git checkout . to get back to a known good state. Without git, you have no safety net.
git init git add -A git commit -m "initial structure"
Claude Code can write a 4-parameter logistic fit in seconds. But it doesn't know whether the IC50 value it computed is biologically plausible. It doesn't know that a CV of 45% means your replicate data is suspect. It doesn't know that your instrument reports absorbance values that need background subtraction first.
You are the domain expert. The AI is the typing assistant. Never accept a result you haven't verified against your scientific understanding.
It cannot validate scientific correctness. Claude Code will produce code that runs and passes tests. Whether the science is right depends on the quality of your specification and your review of the output.
It makes confident mistakes. Claude Code does not say "I'm unsure about this." It writes code that looks correct, runs it, and if the tests pass, it moves on. Silent errors in numerical computation are common.
Complex multi-file architectures can drift. For projects with many interconnected modules, Claude Code sometimes changes one file in a way that breaks another. The fix: keep modules small and independent, and run full test suites after each change.
It has token limits. Very long sessions can cause Claude Code to lose context about earlier decisions. For complex projects, work in focused sessions: one module per session, commit, start fresh.
This produces prototypes, not production code. Phase 1 output is a working prototype. It is not tested to production standards, it lacks comprehensive error handling, and it has not been independently assessed. That's what Phase 2 is for.
Take it to Phase 2: Productizing for test-first hardening, enforcement mechanisms, and a 30-check production readiness assessment using Claude Code with the Claude app.
Switch to Phase 1: Interactive apps which uses Cursor AI for dashboards, GUIs, and visual tools with live previews.
Visit aidrug.dev for the complete three-track lifecycle overview and how these phases fit together.