Plan, script and check a data analysis step by step
Idea + starter prompt, not run by us yet
For: Researchers and analysts who need clean, checkable data work for a report or paper
Kevin Yang had Claude Code write an overall plan, then a detailed plan per part, then one script per step for a research paper. A data-inspection tool listed in CLAUDE.md let it verify its results. He read every script, rolled back with Git when needed, and made the final charts himself.
Steps
- Ask Claude Code to write a plan in a markdown file before any code.
- Break the plan into parts, such as cleaning, each question and outputs.
- Tell it in CLAUDE.md how to inspect your data files so it can check its own work.
- Review every script and commit to Git so you can roll back mistakes.
- Make final charts yourself if describing the tweaks takes longer.
Starter prompt
I need to analyse [describe dataset] in [folder] to answer: [research questions]. 1. Write PLAN.md with the overall steps. Wait for my review. 2. For each step, write a more detailed plan, then one script per step. 3. After each script runs, inspect the output and tell me what you checked. Do not change the raw data files. Save outputs to [output folder]. If you are unsure about a choice, ask me instead of guessing.
Original post: Substack · found via agentusecases.ai. Written up in our own words. We haven't run it, so test it on made-up data first.