PDF invoices to an Excel register with Claude Code: it caught the bad total
One Claude Code prompt read three PDF invoices, built an Excel register with formula check columns, and flagged the invoice whose total was off by 100,000, in about a minute.
By the RanThis team, written with AI assistance4 min read
Why trust this: every result, number and screenshot comes from a real run on our own accounts, not from the AI. How we test
Claude Code can read PDF invoices, build an Excel invoice register and check whether each invoice adds up, all from one prompt. We tested it on three sample invoices, one with a deliberately wrong total: about a minute later we had the register, and Claude had flagged the invoice that was 100,000 off.
Hands-on test
The test: three PDF invoices, one wrong total
We generated three VAT invoices as PDFs. They are sample invoices with made-up data, marked as such at the top of the page, in Vietnamese and in Vietnamese dong. Two are correct. Invoice 0002210 has a deliberate error: goods 3,200,000 plus 10% VAT of 320,000 should total 3,520,000, but the invoice says 3,420,000.

Setup: Claude Code 2.1.301 in a terminal, signed in with a Claude Max plan, in auto mode (a second model reviews each action instead of asking you every time).
Our prompt, typed in Vietnamese, translates to:
Read the 3 PDF invoices in the hoa-don folder and build an invoice register bang-ke.xlsx: invoice number, date, seller, goods amount, VAT, total. Check whether goods plus VAT matches the total printed on each invoice. Don't ask follow-up questions.

That last sentence matters most. Without it, Claude simply copies the numbers into the sheet.
What Claude did in one minute
We didn't touch anything. On screen, Claude:
- Loaded Anthropic's
xlsxskill on its own. - Extracted the text from the three PDFs with a tool already on the machine.
- Rendered the page of invoice 0002210 to an image to look at it, because its numbers didn't add up.
- Found the machine's Python lacked an Excel library and set up its own environment in a temp folder.
- Wrote the file and recalculated every formula. One recalculation attempt failed; it fixed the problem and reran it: 15 formulas, zero errors.
Total time: 1 minute 2 seconds.
Claude's verdict

What we liked: it didn't stop at "off by 100,000". It also checked two things we never asked for: that the line items sum to the goods subtotal, and that VAT matches the rate printed on each invoice (8%, 10%, 10%). Both were fine, so it concluded only the total line is wrong and suggested contacting the seller.
The register

Beyond the six columns we asked for, the file has:
- Three formula columns: Goods + VAT, Difference, Check (Match / MISMATCH), so edits flow through.
- The source PDF filename for each row.
- The mismatched row in red, a totals row counting mismatches, and notes right under the table.
We checked it against the invoices ourselves: goods 8,340,000, VAT 773,000, printed totals 9,013,000, all as in the register.
At the end, Claude Code even pre-filled a suggested next prompt: draft an email to the seller about invoice 0002210.

Before you try it on real invoices
- We only tested PDFs with a text layer (typical of e-invoices you download). Scanned or photographed invoices are untested and may behave differently.
- Real invoices are company data. Check your company's policy on sharing data with AI tools first.
- Always ask for the total check in the prompt. That one sentence turns copying into auditing.
FAQ
Can Claude Code read PDF invoices?
Yes, PDFs with a text layer. In our test it pulled the invoice number, date, seller, goods amount, VAT and total from all three files correctly. We haven't tested scanned invoices.
Will it catch an invoice that doesn't add up?
When you ask it to check totals, yes. It flagged the invoice that was 100,000 off, looked at the rendered page to rule out a misread, and checked line items and VAT rates to pin the error on the total line.
How long does it take?
About 1 minute 2 seconds for three invoices, including reading the PDFs, building the workbook and recalculating 15 formulas.


