Rename and file a folder of scanned receipts
We have a folder of scanned receipts called scan0001.pdf and nobody can find anything at tax time.
What you'll get
Every receipt renamed to date, vendor and total (like
2026-03-03_acme-pipe-and-fitting_186.32.pdf), filed in a folder per month, a backup of the
originals, and a spreadsheet listing them all, with notes on anything it couldn't read. Nothing
moves until you've seen the plan and typed "go".
What you need
- Claude Code installed, and a paid Claude plan (Pro or higher) or an Anthropic Console account. The free Claude plan doesn't include Claude Code.
- A folder of scanned receipts or invoices as PDFs or photos.
- A copy of that folder to practice on. Don't start on the only copy.
Steps
- Install Claude Code. On a Mac or Linux, open Terminal and run the install command below. On Windows, open PowerShell and run the Windows command below.
- Check it worked: run
claude --version. - Copy your receipts folder to a practice folder, for example
receipts-practice, with the scans in a subfolder calledreceipts. - In Terminal or PowerShell, go into the practice folder:
cd receipts-practice(use the real path). - Start Claude Code: type
claudeand press Enter. Log in when it asks, the first time only. - Paste the prompt below and press Enter.
- Read the plan it shows you, especially the "not sure" list. Change anything you want by just telling it.
- Type
goand press Enter. - Open
index.csvin your spreadsheet app and check the notes column. - When you're happy with the practice run, do the same on the real folder.
Install commands, from Anthropic's setup page:
Mac or Linux (Terminal):
curl -fsSL https://claude.ai/install.sh | bash
Windows (PowerShell):
irm https://claude.ai/install.ps1 | iex
When Claude Code asks permission to run a command or edit a file, read what it's asking. For this job it needs to read files, copy, make folders, move and write one CSV. If it asks to delete anything, say no.
Copy-paste instructions
This folder has scanned receipts and invoices in the [RECEIPTS FOLDER NAME] subfolder. I want them renamed, sorted and listed in a spreadsheet. Don't delete anything, ever.
1. First, make a backup: copy every file into a new folder called _originals, with the same names. Do this before anything else.
2. Open each PDF or image. For each one, find the date on the document, the vendor, the total, and what kind of document it is (receipt, invoice, statement or other).
3. Rename each file to YYYY-MM-DD_vendor_total.pdf. Write the vendor in lowercase, letters, numbers and hyphens only, with hyphens instead of spaces, and the total as a plain number like 1240.50. If you can't read a field, put "unknown" there. Never guess.
4. Move each file into a folder for its year and month, like 2026/2026-03/.
5. Write index.csv in this folder with the columns new_name, old_name, date, vendor, total, type, notes. Put anything you weren't sure about in notes.
6. Finish with a short summary: how many files, which ones you weren't sure about, and the total by vendor. Write amounts as plain numbers, no currency sign.
Before you rename anything, show me your plan for every file (old name, new name, folder) and wait for me to say "go".
(Tested with the folder name receipts in place of [RECEIPTS FOLDER NAME].)
How to use it day to day
Scan new receipts into the same receipts folder through the month. At month end, start
claude in the folder again and paste the prompt. It backs up, plans, waits for "go", and adds
the new month's files. Keep _originals until your accountant has the year.
What good output looks like
Real output from a test run on made-up data. Trimmed, not edited.
| # | Old name (in receipts/) | New name | New folder | Type |
| 1 | scan0001.pdf | 2026-03-03_acme-pipe-fitting_186.32.pdf | 2026/2026-03/ | invoice |
| 4 | document.pdf | 2026-04-01_acme-pipe-fitting_0.00.pdf | 2026/2026-04/ | statement |
| 6 | scan0002.pdf | 2026-04-09_example-fuel-stop-12_unknown.pdf | 2026/2026-04/ | receipt |
- scan0002.pdf: the total line reads "[faded, unreadable]", so it's unknown. The slip I see shows no gallons or price to confirm an amount.
- document.pdf: this Acme statement shows a balance due of 0.00, so that is its total. It lists invoice A-10422 for 186.32 (scan0001.pdf) and a payment of that amount received 03/28/2026. The 186.32 should be counted only once.
- Vendor names: I dropped the "&" from "Acme Pipe & Fitting" and "Sample Tire & Lube", and kept the store number in "Example Fuel Stop #12".
Reply "go" to proceed, or tell me what to change.
It backed up all six files first, left the faded total as unknown instead of guessing, caught
that the statement and the invoice were the same 186.32, and kept the & out of every file name.
(Claude Code 2.1.333 with Claude Sonnet 5.5, on six made-up receipts.)
When it goes wrong
- It asks to run a command you don't recognize. Say no and ask it what the command does. You can stop it at any time with Esc.
- It can't read a photo or a faint scan. It'll put "unknown" in the name and say why in notes. Rename those few by hand.
- Two files would get the same name. Same vendor, same day, same total. Tell it to add
-2to the second one. - You ran it on the real folder and don't like the result. Everything is still in
_originals. Delete the new month folders and copy the originals back.
Rather have it done for you?
I can set this up so new scans get named and filed as they land, with the list kept up to date for your bookkeeper.
The recipe's free. If you'd rather eat than cook, give me a call.