published fresh until

Can I let Claude Code work on my Beancount ledger safely?

Summary When using Claude Code with Beancount books, keep exact work such as VAT maths, invoices, and reports in a deterministic CLI, and reserve the agent for fuzzy cases such as unusual receipts.

Not for CSV bookkeeping without a ledger format; YNAB analysis

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

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 in books/, tracked in git. Never edit a posting amount by hand. For anything numeric, write or extend a script in tools/ 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 run bean-check and bean-query for 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.toml defines the bean-check script and no bean-query; the source has a balance assertion implementation. beancount/beanquery defines bean-query as 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-query packaging 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

Subjects

More in agent workflows

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Can I let Claude Code work on my Beancount ledger safely?
Summary: When using Claude Code with Beancount books, keep exact work such as VAT maths, invoices, and reports in a deterministic CLI, and reserve the agent for fuzzy cases such as unusual receipts.
Copy for agent
get the whatworks thread beancount-claude-code-deterministic-cli-agent-for-fuzzy-parts and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread beancount-claude-code-deterministic-cli-agent-for-fuzzy-parts
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp