Your first data task in Claude Code: profile a CSV

A good first Claude Code task for an analyst: point it at a CSV and get a profile of every column, then keep the script. The four steps, the prompt, what a useful profile contains, and how to check it.

Short answer: install Claude Code, open a terminal in the folder with your file, type claude, run /init once, and ask: "Write a Python script that profiles sales.csv: rows, columns, types, blanks, distinct counts, min and max per column, and values that look wrong. Run it and save the result as profile.md." You get a profile and, more useful, a script you can run on next month's file.

A profile is the first thing to do with any new data, and the most boring. It is also a perfect first task for an agent: clear, checkable, and safe, because it only reads the file.

Nothing loads from YouTube until you press play. Then Google receives your IP address and may set its own storage. Narrated with an AI-generated voice. Privacy

What are the four steps?

  1. 1
    Installone line on Mac, Linux or Windows; a paid plan or Console account
  2. 2
    Open the foldercd to the project, type claude
  3. 3
    /initClaude writes CLAUDE.md with notes about the project
  4. 4
    Askthe profile request, then read the script it wrote
From install to a profile

What should a profile contain?

CheckWhy it matters
Row and column countMatches what you expected to get?
Type per columnDates read as text, numbers read as text
Blanks per columnMissing values to handle before any sum
Distinct valuesAn ID column with duplicates is not an ID
Min and maxNegative quantities, dates in 1900 or 2099
Top values"N/A", "unknown", "-" hiding as real values
A useful column profile

How do you check what it did?

  • Read the script, not only the result: it should read the file and nothing else.
  • Spot-check one number: count the rows yourself, or open the file and look at one column's blanks.
  • Run it again on another file with the same columns; a good script works without changes.

What should you do with the result?

Turn the problems it finds into cleaning steps, and keep the script in the project. Next time, "run the profile on the October file" takes seconds, and Claude can compare it with September's.

Where can you check this?

Where do you start?

Clean what the profile finds with prompts for cleaning data, and see what else Claude Code can do with data in Claude Code for data analysts.

Keep reading

More from the blog.

Every post

Next

Building this? Say hello.

A question about this post, a pattern you would build differently, or the next thing you want written out: Behnia reads every message.