Skip to content
Practice2026-08-0612 min read

Clean a Messy Customer List With Claude Code — and Prove Nothing Was Lost

Every business has one: the customer list that lives half in a spreadsheet, half in an inbox, and half in someone's head. Here is how to clean it in about twenty minutes, and — the part nobody teaches — how to prove the cleaning did not quietly drop forty rows.

Key takeaways

  • Getting a model to tidy a list is the easy half. Knowing it did not lose anything is the half that matters.
  • Audit before you fix: ask what is wrong before asking for it to be corrected.
  • Three counts make the cleaning checkable — rows in, rows out, rows deliberately merged.
  • Anything the agent could not resolve goes on a list you read, never into a silent default.
  • The twenty minutes this takes is the number worth writing down.

Rod Rivera

Author

Clean a Messy Customer List With Claude Code — and Prove Nothing Was Lost

Rod's note — read with a pencil; the margins are for you.

The list everyone has

Customers in a spreadsheet somebody started in 2019. Newer ones in the email inbox. A few only in the quoting system. The same company appears as Meridian Ltd, Meridian Limited and meridian ltd. — three rows, one customer. Half the phone numbers have a country code and half do not. Two hundred rows, or two thousand, and nobody wants to be the person who sorts it out because sorting it out takes a weekend.

Meridian Ltd is a constructed example, stated up front

The list and the failure cases below (Meridian's three-row duplicate, the UK/GB country-code readout) are a built illustration, not a real customer export, and the twenty-minute figure is an estimate for a list of this shape and size, not a timed run of this exact file. The failure modes themselves — inconsistent suffixes, a silently dropped row, a duplicate merge that shouldn't have happened — are the real, common shapes this process actually catches. Told you now, not at the bottom, because the specifics below only work as illustration if you know that's what they are.

Reading this page takes about twelve minutes. Actually doing the cleaning it describes takes about twenty — two different numbers, both worth knowing. The cleaning part is not the interesting bit — any competent model will tidy a spreadsheet. The interesting bit is the last section of this page, where you find out whether it quietly threw away forty of your customers while it was tidying.

What you need

A CSV or Excel export of your list, Claude Code installed, and a folder you can work in. No database, no pipeline, no subscription to anything. If your list is in a paper book, this article is not yet for you — though photographing it is a different piece.

Step one: audit before you fix

The instinct is to ask for the clean version straight away. Don't. Ask what is wrong with it first, and read the answer before anything gets changed.

Put the file somewhere on its own

A new folder with one file in it. Not your desktop, not the folder with the other nineteen exports. You want to be able to see exactly what changed.

Ask for a description, not a correction

"Read customers.csv. Describe what is inconsistent about it — column by column. Do not change anything yet."

The point is that you find out what it thinks the problems are before it acts on that judgement. Most surprises happen here, cheaply.

Read the description properly

This is the step people skip. If it says one thing that is wrong about your business — that "Region" is a country when actually it is a sales territory — you have just saved yourself an afternoon of undoing.

What usually comes back: company names with inconsistent suffixes, phone numbers in four formats, emails with trailing spaces, countries as a mix of names and codes, empty cells that mean "unknown" in some rows and "none" in others, and duplicates that are only duplicates if you squint.

That last one is the decision the agent must not make alone. Two rows for the same company at different addresses might be a duplicate, or might be two sites you invoice separately. You know; the file does not.

Step two: the actual cleaning

Terminal
$
claude

Then, roughly:

Standardise this list. Company suffixes to a single form. Phone numbers to E.164 (the international standard format, + and country code first — +44 20... instead of 020...) with the country code. Emails lowercased and trimmed. Countries to ISO codes (the standard two-letter country abbreviations — GB, not "United Kingdom" or "UK"). Write the result to customers-clean.csv and do not delete any row — mark suspected duplicates in a new column called duplicate_of instead.

The instruction that matters is the last one. You are separating two operations that feel like one: standardising (safe, reversible, mechanical) and merging (a judgement about your business). Let the agent do the first and only propose the second.

Files changed
customers-clean.csv
duplicates-to-review.csv
none

Step three: prove it did not lose anything

This is the part that makes the difference, and almost nothing written about AI data cleaning covers it.

A model that tidies your list will tell you it tidied your list. It will sound confident. It will usually be right. And when it is wrong, it is wrong silently — a parsing error on row 412 drops the rest of the file, a "cleanup" step removes rows with blank emails, and you find out in March when a customer asks why they stopped receiving invoices.

Three counts turn that from a hope into a check.

The check, as a gate rather than a habit

Ask for exactly this:

Before and after: how many rows? List any original row that has no corresponding row in the output, by its original line number. And show me every distinct value you changed in the Country column, with counts.

Three answers, and each one catches a different failure:

Row count in versus out. Must match exactly, because you told it to delete nothing. If it does not match, stop — you have found a bug, not a cleaning.

Unmatched originals, by line number. Catches the subtler case where the count is right but the contents shifted — a row silently replaced rather than dropped.

Distinct values changed, with counts. This is the one that finds the real mistakes. "United Kingdom → GB (412)" is fine. "United Kingdom → GB (412), UK → GB (88), Ukraine → GB (3)" is a bug you would never have found by reading the file.

Want the prompts as a file?

The three prompts above, the verification gate, and a column-mapping table you can run against your own export.

The failure this is actually protecting you from

Not a dramatic crash. A quiet, plausible, correct-looking output that is missing something. A green result is not a check — it is a claim. The counts are the check, and they cost one extra question.

Step four: the list you have to read yourself

Whatever the agent could not resolve goes in a file you open — never into a default it picked on your behalf.

Everything you were unsure about: put it in needs-a-human.csv with a column saying why.

Twenty rows you decide in five minutes beats two thousand rows you trust in none. The suspected duplicates go here too. You are the only one who knows whether those two Meridian rows are one customer or two sites.

The number worth writing down

When you are finished, note how long it took. Not roughly — actually.

Then ask the more useful question: how many other jobs in your week look like this one? The quote that gets retyped into the invoice. The supplier list that gets reconciled by hand every month. The enquiries that get copied from the inbox into the spreadsheet.

The first number is often surprising and the second uncomfortable — this is a repeated pattern in how operators react once they start timing tasks rather than estimating them, not a measured statistic. That gap — between the hours a task actually costs and the hours you assumed — is the whole reason this matters. A Zero-Employee Organization (ZEO) is just a business that has taken that question seriously across every task, one at a time, and has the numbers to prove what changed.

Not by buying software. By doing the job once with an agent, checking it properly, and writing down what it cost.

Do this before you automate anything else

The task you should hand over first is not the most annoying one. It is the one you can check most easily. Cleaning a list qualifies: the correct answer is countable. Start where verification is cheap and you will build the habit before you need it somewhere it is expensive.

The cohort

One month, for operators who already run something real and want to run it without hiring. We work through your actual operations the way this page works through a customer list.


If you run this on your own list and it finds something this page did not predict, that is worth telling us about.

Ready to put an agent to work?

Join the Prof Rod newsletter for one educational lesson a week, with worked examples attached. It is free to register for and separate from the Zero Employee community.