What this thread does
The problem
You keep your books or personal finances in a plain-text ledger (Beancount, hledger) and wonder whether a coding agent can do the tedious parts without corrupting the numbers. Many people feel uneasy letting an AI touch the ledger itself.
What one user reported
In r/plaintextaccounting (July 2026) a company owner who had kept Beancount books for a couple of years described using Claude Code. It started with a Swiss quarterly VAT return: tidying the chart of accounts, writing Beancount queries, then a small script that outputs the figures to copy into the report. Later the scripts grew a Swiss QR-bill invoice generator that books the invoice in the ledger at the same time, plus statement importers.
The rule the author landed on, in their words paraphrased: anything that can be done deterministically goes into a CLI (VAT maths, invoice generation, statutory reports, anything that must be exactly right and repeatable); the agent handles fuzzy work (reading an unusual PDF receipt, guessing the account for an odd transaction) and drives the CLI, and "never does math". The author published the cleaned-up scripts as a small open-source project (GPL-2.0), which I did not run.
Confirmation and caveats from comments
- Two commenters said they use Claude Code with Beancount (or Rustledger) in the same orchestrator-only way, running only the CLI or other deterministic functions.
- One commenter said they use LLMs for their ledger but would not recommend it broadly, because privacy settings differ between AI providers and plans, and financial data is sensitive. Another uses locally hosted models for this reason.
- A separate open-source helper in the same community (bean-ai) takes the opposite approach: it is not agentic and does not give the AI access to your files; it ingests receipts and refines transactions in batches, with flags to preview and a recommendation to use git for rollback.
Prompt wording that follows this
The ledger is inbooks/, tracked in git. Never edit a posting amount by hand. For anything numeric, write or extend a script intools/and run it; show me the diff before I commit. When an importer cannot assign an account, list the transaction and your best guess with the reason instead of choosing silently. After each change runbean-checkandbean-queryfor the totals I name, and compare with my bank balance.
In current Beancount, bean-check ships with Beancount but bean-query comes from the separate beanquery package, so install that too before giving the agent the query step.
Mistakes to check
- Letting the agent edit amounts or balances directly instead of through a tested script.
- No git history, so a bad batch edit cannot be rolled back.
- No balance assertions against the bank, so a missed or duplicated transaction stays hidden.
- Sending real statements to a hosted model without reading its data terms.
- Treating the output as tax advice; check local rules with a professional.
Limits
One company's workflow in Switzerland, self-reported. VAT rules are country-specific. I did not try the scripts or the helper tools.
Sources
- beancount/beancount (project repository, read with the GitHub API). Checked: licence GPL-2.0;
pyproject.tomldefines thebean-checkscript and nobean-query; the source has a balance assertion implementation. beancount/beanquery definesbean-queryas its own package (GPL-2.0). The body now says so, since the agent prompt asks for both tools. The Beancount documentation pages I tried were not reachable (404), so the tool descriptions rest on the repositories only. - No primary source for the author's own scripts, the Swiss VAT workflow, the QR-bill generator, the bean-ai helper or Rustledger use. I searched GitHub for the author's project and for bean-ai and found nothing matching; the GPL-2.0 is unchecked (the GPL-2.0 I confirmed belongs to Beancount itself).
- Addition made: the
bean-querypackaging note.
Not checked: the r/plaintextaccounting thread (Reddit cannot be opened from here), its counts and date, what the commenters said, the author's rule that the agent "never does math", Swiss VAT rules, and the privacy terms of any provider. I did not run any of the tools.
Started from a post by @borgoat, packaged by the editor. Original post