Advanced · Finance and admin · About 60 minutes

Analysing your business data with Claude Code

An analysis of sales, customers and margins drawn from several exports at once.

Put exports from your accounts, sales and customer systems into one folder and have Claude Code clean them, join them and show you which customers and products make the money. You choose the questions, approve each step and prove the findings against your accounts before you act.

The lessons

  1. Decide the questions worth answeringFree to read
  2. Export from accounts, sales and CRMAdvanced plan
  3. Have Claude Code clean and join the dataAdvanced plan
  4. Find your best customers and worst marginsAdvanced plan
  5. Verify the findings against the sourceAdvanced plan
  6. Build a report you can rerun each quarterAdvanced plan

What you finish with

  • A cleaned, joined data set built from your exports, with a record of every row that did not match
  • A findings report on your best customers and your worst margins
  • A verification sheet proving the totals against your accounts
  • A saved skill that reruns the whole analysis each quarter

Lesson one · free to read

Why this matters

The most useful questions in a small business cross systems. Which customers make you money once the cost of serving them is counted? The sales are in one export, the costs in another and the customer details in a third. Nobody has the day it takes to join them by hand.

Claude Code is Anthropic’s tool that works directly with the files in a folder on your computer. You describe what you want in plain English. It reads the files and writes small programs to process them. It can also be wrong at speed: join two files on the wrong column, count an invoice twice or drop the rows that did not match without telling you. So you set the questions, approve the steps and reconcile the totals to your accounts before a single finding is believed.

Before you start

This course assumes Claude Code is installed and you have used it once. If not, take “Setting up Claude Code on your computer” first. If something looks different from what I describe, type /help to see what is available.

You can run it from the Code tab of the Claude desktop app: pick the local environment under the prompt box, then open your project folder. Or use a terminal, the window where you type commands to your computer: open one in your project folder and type claude.

Four safety rules.

  1. A dedicated folder. Make a new folder called business-analysis. Claude Code works on the folder you start it in, so never start it in Documents or a shared drive.
  2. Backups outside the folder. Keep an untouched copy of every export somewhere else. The /rewind command undoes edits Claude Code made to files. It does not track changes made by programs it runs, so it is not a backup.
  3. Review before approving. Use the Manual permission mode, where Claude Code asks before it edits a file or runs a command.
  4. No credentials. No logins, passwords or keys. It works from files you exported yourself.

Now the data. Claude Code runs on your computer, but the contents of the files it reads are sent to Anthropic to be processed, as text pasted into a chat would be. So delete columns holding contact names, email addresses, phone numbers and street addresses. Keep the customer account code, drop the customer name and keep the list matching codes to names outside the folder. No payroll by person. No bank details.

What comes out is management information, not a set of accounts. Have your accountant look at the findings before you change prices, drop a customer or rely on a margin figure for anything that goes to HMRC or a lender.

Step 1: Decide the questions worth answering

Analysis fails most often before any data is touched. “Tell me something interesting” gets forty charts with no decision in them. A question is worth answering if a clear answer would change what you do.

Write down three to five. Two are already in the prompt below.

Create your business-analysis folder, start Claude Code in it and switch to Plan mode. In Plan mode Claude Code reads and proposes but does not change your files. In the desktop app, choose Plan in the mode selector under the prompt box. In the terminal, press Shift+Tab until the mode shown is plan.

I am planning an analysis of my business data. Do not create or change any files yet.

My business: [TWO SENTENCES: WHAT YOU SELL AND TO WHOM]

My draft questions:
1. Which customers are worth the most to us by margin, not only by sales?
2. Where is our margin worst: which products, services or kinds of job?
3. [YOUR QUESTION]

For each question:
- restate it so precisely that two people would work it out the same way
- list the data needed to answer it
- name the definition I must decide, such as what counts as "margin" or "a customer"

Do not suggest answers. Do not define margin for me. Ask me.

The definitions are your decisions. “Margin” might be sales less materials. It might also take off labour, delivery or subcontractors. If you are unsure, ask your accountant which costs are directly tied to a sale in your books.

Here is how this went for a wholesale bakery in Wrexham that supplies cafés and shops. The owner’s first question was “who are our best customers?” Restated, it became “for each customer account over the last twelve months: net sales, cost of ingredients for what they bought and number of deliveries”. Deliveries turned out to be the whole story.

Then leave Plan mode and ask Claude Code to save the agreed questions and definitions in a file called questions.md.

What good looks like: one page of three to five exact questions, each with a decision beside it and a definition you chose.

Step 2 gets them into the folder in a safe state.

Send me a message.

I reply within one working day.

Your details are used to reply to you and for nothing else.