Books onAutopilot

An autonomous accounting system. A cron-driven Claude Code agent ingests invoices from four channels, books them under the correct German VAT rule, reconciles them against the bank feed, and forecasts the next quarter — all while Postgres holds the source of truth and a human approves every entry.

Claude Code RuntimesevDesk · SupabaseGerman VAT Engine
cron · accountant-agent
+
+

Bookkeeping you can't outsource — but shouldn't do yourself

Small businesses live in a paper-cut economy: invoices arriving by email, portal links and PDF dumps, German VAT rules with a dozen edge cases, and a monthly P&L that takes a weekend to produce. Generic OCR “automate my receipts” tools cover the easy 80% — the missing 20% is where the books actually break.

0
Ingestion Sources Unified
0
VAT Treatments Encoded
0
Cron-Driven Workflows
0
Invoices Manually Retyped

Six Steps,No Babysitting

Every step is a deterministic Python tool. Claude is the orchestrator, not the source of truth — Postgres is.

01

Ingest

Cron polls Gmail IMAP for unread invoices, watches an iCloud dump folder, and listens for Stripe, RevenueCat and Clockify webhooks. Each artefact is fingerprinted with a SHA-256 of its raw bytes.

Gmail IMAPwatchdogStripeRevenueCat
Output: Raw artefacts queued in dump_queue — duplicates rejected on fingerprint match
02

Split & OCR

Multi-invoice PDFs are split per page so a five-vendor email becomes five voucher candidates. Each page is OCR'd, fingerprinted again, and matched to the vendor cache.

pypdfOCRpg_trgm vendor match
Output: One voucher candidate per invoice, vendor pre-matched
03

VAT Booking

A domain-specific classifier picks one of ten enumerated VAT treatments. Reverse charges (§13b), inner-community supplies (§4 Nr. 1), Kleinunternehmer, reduced rates and Versicherungsteuer all have explicit rules — no LLM guessing.

VIES VAT-ID checkHardcoded BMF rulessevDesk API
Output: A draft voucher in sevDesk + a row in pending_review
04

Reconcile

Bank transactions from Qonto (mirrored via sevDesk) are matched to vouchers within a ±4 day, ±5% window. Receipts that should exist for a transaction but don't are surfaced as missing items.

Postgres fuzzy matchQonto via sevDesk
Output: missing_items flagged in the review dashboard
05

Forecast

Three forecasting methods (trailing average, per-month historic, Clockify pipeline) run for three scenarios (conservative, expected, optimistic). Cash runway, projected P&L and tax estimates land in forecast_runs.

Materialised viewsClockify hours × contract rates
Output: mv_runway, mv_projected_month, mv_contract_revenue refreshed
06

Approve

A Next.js dashboard shows the queue. One click writes to sevDesk, refreshes the views, and the agent's job is done. Humans stay in the approval loop — Claude never closes the books unattended.

Next.js 15AG GridSupabase server actions
Output: Books closed; audit trail preserved end-to-end

It isn't the agent. It's the German VAT code.

A generic invoice processor works until it meets a §13b reverse charge from a US SaaS vendor, a §4 Nr. 1 inner-community acquisition with a valid VIES VAT-ID, or a Kleinunternehmer invoice with no VAT at all. Each treatment is encoded as a typed value with explicit booking rules — auditable, testable, and readable by your tax advisor.

de_19_standard
Standard 19%
Default for German B2B services and goods.
de_7_reduced
Reduced 7%
Books, food, hotel nights, public transport.
reverse_charge_13b
Reverse Charge §13b
US/UK SaaS — VAT booked on the buyer side.
intra_eu_acquisition
Intra-EU §4 Nr. 1
EU vendor with valid VIES VAT-ID — net invoice.
kleinunternehmer
Kleinunternehmer §19
No VAT charged or deductible.
versicherungsteuer
Versicherungsteuer
Insurance tax, non-deductible Vorsteuer.
asset_acquisition
Anlagengut
Booked into AfA, not the operating P&L.
private_withdrawal
Privatentnahme
Owner draw — never expensed.
shareholder_loan
Gesellschafterdarlehen
Treated as financing, not income or expense.
export_eu_oss
OSS / Export
Distance sales handled via the One-Stop-Shop scheme.

Three Scenarios.Always.

Most accounting tools give you one number and call it a forecast. This one runs three methods — trailing average, per-month historic pattern, and Clockify pipeline — and projects each under conservative, expected and optimistic assumptions.

Results land in the forecast_runs table so trends can be compared over time. Cash runway, monthly P&L, and quarterly tax estimates all use the same underlying view — no spreadsheet drift.

mv_projected_month · Q3 2026
€ 18.4k
Conservative
€ 24.1k
Expected
€ 31.7k
Optimistic
method: pipeline · runway: 9.2 months

Claude orchestrates. Postgres remembers.

Each cron fires a fresh Claude Code instance — no daemon, no drift. State lives in Supabase Postgres. Tools are Python scripts invoked by the agent via Bash, so every step is auditable and testable in isolation.

01
Gmail / Stripe / Webhook
Sources
02
Cron + Claude Code
Orchestrator
03
Python Tools
Deterministic
04
Supabase Postgres
Source of Truth
05
Next.js Dashboard
Approval UI
06
sevDesk
System of Record

Want a systemlike this?

Tell us what you're tracking — and what you're not. We'll map out an agent that handles the boring half so you can stop dreading the close.