Building an AI powered bookkeeping workflow
AI
Claude
Claude Cowork
- Python
Every quarter, a Spanish autónomo has to turn a pile of bank movements and receipt PDFs into something the tax authority accepts: the official Libros Registro, and the numbers that go on the Modelo 130 and the IVA 303 - or the IGIC 420, if you live in the Canaries as I do.
The obvious solution to this chore is to sign up to an online bookeeping service - but all that I've tested fall short: they either do not support the Canary Islands "special zone" - or they can't deal with multiple types of activities in one autónomo.
I am working on a Claude Cowork-powered workflow that makes this significantly easier.
What it does
- Ingests bank exports and receipt PDFs
- Reconciles the receipts against the movements on the statement
- Classifies each expense the way an accountant would, deductible share and all
- Writes the Libros Registro out as Excel ledgers
- Calculates the figures for the quarterly filings
- Issues sequentially numbered, locked invoices as PDFs
Deterministic first, AI second
The interesting part is how little of it is left to the model. Parsing is deterministic: plain command line tools read the statements and the PDFs, and the AI is only asked the questions that genuinely need judgement, such as what a given expense is and how much of it is deductible.
Every figure in the ledger links back to the source file it came from, the whole pipeline is idempotent and safe to re-run, and the rules are applied skeptically rather than generously - when something is unclear, it asks instead of guessing.
It learns your business once
Classification questions that cannot be answered from the rules are put to me once, and the answer is written into a memory file. The next quarter, the same merchant is already understood. Over a couple of quarters the number of questions drops to almost nothing.
The workflow runs as a set of reusable skills - dictate an invoice, add a receipt, close a quarter - so the day-to-day interaction is a sentence, not a spreadsheet.
Work in progress
This is pre-alpha, research-only software and I am building it in the open. The output does not conform exactly to AEAT requirements yet, so everything it produces still gets verified before it is filed. There is an untested German variant for the EÜR and UStVA, because the shape of the problem is the same everywhere.
The code is on GitHub, together with a complete example tenant and the documentation needed to rebuild the whole thing from scratch.
Want a workflow like this for your own paperwork? Let's talk.