Phase 1 · Non-Interactive Apps

Vibe Coding with Claude Code

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

What is Claude Code?

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.

When to use Claude Code vs Cursor AI

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 AI — interactive apps

  • Dashboards and data visualisations
  • GUIs for lab instruments or protocols
  • Web applications with user interfaces
  • Anything where you need to see the output while building

Cursor gives you live previews, inline code editing, and visual feedback loops. Best when the output is a screen.

Claude Code — non-interactive apps

  • Data processing pipelines (CSV → analysis → report)
  • Command-line tools and batch scripts
  • APIs and web services (Flask, FastAPI)
  • File transformation and ETL workflows
  • Bioinformatics pipelines

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.

What are non-interactive apps?

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.

📊

Data pipelines

Read raw experimental data, clean it, compute statistics, produce formatted output. E.g., plate reader CSV → IC50 table.

⚙️

CLI tools

Command-line utilities your team runs from terminal. E.g., annotate-variants --input data.vcf --output report.tsv

🔌

APIs & services

HTTP endpoints that accept requests and return results. E.g., a FastAPI service that computes molecular descriptors on demand.

🔄

ETL & file processing

Extract-Transform-Load workflows. E.g., pull data from an instrument, standardise formats, load into a database.

🧬

Bioinformatics scripts

Sequence analysis, BLAST wrappers, FASTA/FASTQ processing, phylogenetic tree construction, variant calling pipelines.

📧

Automated reporting

Scripts that run on schedule, generate summary reports from data, and email or save results. No human interaction required.

The three-tool workflow

Building non-interactive apps uses three tools in sequence. Each has a specific role. Do not skip or merge the steps.

1. CLAUDE APP (CLAUDE.AI) Think & plan. Write the spec. Requirements & test cases SPEC 2. CLAUDE CODE (TERMINAL) Build. Claude writes code & runs it. Files, tests, dependencies CODE 3. WORKING PROTOTYPE Test on real data. Iterate: back to step 1 or 2 Phase 2 when ready

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.

Prerequisites

Before you start, you need a few things installed on your machine. This guide assumes macOS, but Claude Code also works on Linux.

Node.js (v18+)

Claude Code is an npm package. Install Node.js from nodejs.org (LTS version). Verify: node --version

Python 3.12

Your applications run Python. Install via python.org or Homebrew: brew install python@3.12

uv package manager

Fast Python package manager. Install: curl -LsSf https://astral.sh/uv/install.sh | sh

Anthropic account

You need an active Claude subscription (Pro, Team, or Enterprise) to use Claude Code. It uses your Anthropic account directly.

Installing Claude Code

Terminal
# 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.

Starting your first project

Terminal — create project and start Claude Code
# 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.

Project structure Claude Code will create

Typical project layout
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

The CLAUDE.md file

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.

Example CLAUDE.md
# 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.

The two-phase Claude Code workflow

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.

Phase A: Specification (Claude App)

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:

A1
Describe the problem in domain language
Tell Claude what the tool does, who uses it, and what data it works with.

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."

A2
Define test inputs and expected outputs
This is the most important step. Without test cases, the AI cannot verify its own work.

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.

A3
Ask Claude to generate the full specification
Ask Claude to produce a structured spec document you can paste into Claude Code.

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.

Phase B: Implementation (Claude Code)

Now switch to your terminal. Start Claude Code in your project directory and paste the specification.

B1
Paste the specification into Claude Code
Start with: "Here is the specification for this project. Implement it."

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.

What you type in Claude Code
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]
B2
Let Claude iterate on failures
Claude Code will run tests and fix errors. Let it work.

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.

B3
Test with real data
Run the tool on actual experimental data and validate the results.

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."

B4
Iterate or declare prototype complete
Go back to step A1 or B1 as needed. When it works, you have a Phase 1 prototype.

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.

Practice Exercise: CSV Analysis Pipeline

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.

The task

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

Step 1: Specification in Claude App

Open the Claude app and use this prompt as a starting point:

Prompt for Claude App
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.

Step 2: Review the specification

Claude will produce a structured specification. Before pasting it into Claude Code, verify:

Check these

  • Are the function signatures reasonable?
  • Do the test cases match your expected outputs?
  • Are edge cases covered (empty file, single row, missing values)?
  • Is the project structure clear?

Common issues

  • std calculation: population vs sample? (Use sample: ddof=1)
  • Rounding errors: verify the expected numbers yourself
  • Missing data handling not specified
  • No test for the CLI argument parsing

Step 3: Build in Claude Code

Terminal
# 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."

Step 4: Validate

After Claude Code finishes, run the tool yourself:

Terminal — outside Claude Code
# 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.

Golden Rules

These rules come from real experience teaching scientists to vibe code. They are not theoretical. Violating any of them will cost you time.

1
Always include test inputs and expected outputs
Without them, the AI writes tests that confirm its own mistakes.

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.

2
Separate planning from building
Claude app for thinking. Claude Code for doing. Never mix them.

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.

3
Use CLAUDE.md for project conventions
Write it once. Claude reads it every session.

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.

4
Initialise git before you start Claude Code
You need an undo button. Git is your undo button.

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.

Before starting Claude Code
git init
git add -A
git commit -m "initial structure"
5
Your domain knowledge is irreplaceable
Claude writes the code. You verify the science.

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.

Honest assessment: what Claude Code cannot do

⚠ Reality check

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.

Where to go from here

When you have a working prototype

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.

If you need an interactive app instead

Switch to Phase 1: Interactive apps which uses Cursor AI for dashboards, GUIs, and visual tools with live previews.

For the full methodology

Visit aidrug.dev for the complete three-track lifecycle overview and how these phases fit together.