ChatFin/Build Balance Sheet Reconciliations with Claude

How to build balance sheet reconciliations using Claude

By Ashok ManthenaPublished 5 Nov 202610 min read
Three rows of accounts.csv (accounts 1010, 1700 and 1900) go into Claude. The same accounts come out in recon_status.csv: 1010 reconciled with a difference of -9184.60 fully explained, 1700 unreconciled with 11359.45, and 1900 with no support. A note reads 24 of 24 accounts matched our reference answers.
You need
Trial balance, support balances and reconciling items, as two CSV files
Tested with
Claude Sonnet 5.5, made-up data, 5 Nov 2026
Result
24 of 24 accounts matched our reference answers

Before you start

A reconciliation passes review on three conditions: the preparer did not review their own work, no old item is hiding in the list, and the unexplained balance is small.

Checking those across every account each month is a loop with some rules in it, the kind of script that used to wait for a developer. On 5 Nov 2026 we wrote the nine rules in plain English and Claude wrote the script in one sitting.

Our test file is small: 24 accounts and 13 reconciling items.

It has an account that is off by exactly 1.00, one off by 1.01, an item exactly 90 days old, an item entered with the wrong sign, a goodwill account that one person prepared and reviewed, and an item that points at an account that does not exist.

A real ledger adds entities, sub-accounts that roll up into one line, support that arrives as a PDF, and preparers who explain differences in their own ways. Each of those is another rule to write down and keep.

Our view is that mid size and large companies should not build and maintain this themselves. When a status looks wrong, someone has to find which rule caused it, and the person who wrote the script may have left.

The first version was the quick part. For the trade-off, read Build vs Buy: Finance AI Agents in 2026.

What you need

An ERP connection

You need the trial balance at the close date: one row per balance sheet account with its GL balance. You also need the support balance for each account from wherever it lives (bank statement, subledger report, schedule), and the open reconciling items with their dates.

Check how your ERP lets you export the balance sheet, and what its API terms allow before you point an AI tool at it.

Our script reads two CSV files and writes one. It does not write to the ERP.

The data points

Columns in accounts.csv and reconciling_items.csv
ColumnUsed for
account, nameOne result per account. Keep account numbers as text
gl_balanceThe ledger side of the difference
support_balanceThe other side. Blank means no support, which is not the same as 0.00
preparer, reviewerThe control check. Same person, or no reviewer
item_id, account, amountThe items that explain the difference, signed so that GL minus support equals their total
item_dateWhether an item is more than 90 days old at the close date

A plan, broken into steps

Attach accounts.csv and reconciling_items.csv and paste this.

Prompt 1: plan
I work in the accounting team. I want a small tool that checks our balance sheet account reconciliations at month end.

I have two files:
- accounts.csv: one row per balance sheet account (account, name, gl_balance, support_source, support_balance, preparer, reviewer). support_balance is the balance on the supporting document, such as a bank statement or a subledger. It is blank where we have no support.
- reconciling_items.csv: items that explain a difference (item_id, account, type, amount, item_date, description). An item is signed so that gl_balance minus support_balance equals the total of the account's items.

Close date is 31 Oct 2026. Our policy:
1. Difference = gl_balance minus support_balance.
2. Explained = the total of the account's reconciling items.
3. Unexplained = difference minus explained.
4. An account with no support_balance is "no support".
5. An account whose unexplained amount is more than 1.00 in either direction is "unreconciled".
6. An account that is not unreconciled and has the same person as preparer and reviewer, or no reviewer, is a "control exception".
7. An account that is none of the above and has a reconciling item dated more than 90 days before the close date is "reconciled, aged items".
8. Everything else is "reconciled".
9. A reconciling item for an account that is not in accounts.csv must be listed as an exception.
Apply the statuses in the order above and give each account one.

Do not write code yet. Break the job into numbered steps. For each step say what could go wrong. Then list anything in the policy that is unclear.

Claude gave eight steps. Before writing any code it worked the policy through by hand and gave us its expected answer: 14 reconciled, 2 with aged items, 4 unreconciled, 2 with no support and 2 control exceptions, plus one orphan item.

It also found the traps we had planted. Account 1400 is off by exactly 1.00 and account 2810 by 1.01, so a floating-point error would flip one of them. Item 1600-01 is exactly 90 days old, so "90 or more" gets it wrong. Account 2800 has an item of the wrong sign.

It then listed six points that are unclear or open. Three of them:

  • What happens to an item dated after the close date? As written it counts as explained.
  • An aged item on an account that is already unreconciled is not shown, because the status order hides it. Claude suggested a notes column to show it.
  • Should items on an account with no support matter? As written, no.

Settle before relying on it. We did not answer these. We told Claude to use its plan, and it read that as "follow the wording as written". Your controller decides all six.

Ask Claude to build it

Prompt 2: build and run
Good. Use that plan. Write one Python script, standard library only, that reads both files and writes recon_status.csv with one row per account: account, status, difference, explained, unexplained. Use exact decimal arithmetic for money. Never change my files. Run it, then show me how many accounts are in each status, every account that is not "reconciled", and any item for an unknown account.

Claude Sonnet 5.5 (claude-sonnet-5-5) ran both prompts on 5 Nov 2026. The first run took the prompts one at a time, as two turns. The script is 145 lines of Python, standard library only, with money held as Decimal.

Claude said it compared checksums of both input files before and after the run. The script stops with a message, instead of guessing, on a duplicate account, a duplicate item ID, a bad amount or a bad date.

The result was 14 reconciled, 2 reconciled with aged items, 4 unreconciled, 2 with no support and 2 control exceptions, and it listed item 3000-01 as belonging to an unknown account. Here are the ten accounts that are not plain "reconciled":

Accounts that are not reconciled
AccountNameStatusWhy, in our words
1700Intercompany receivableUnreconciledAn item of 12,000.00 explains a difference of 11,359.45, so 640.55 is left over.
2700Accrued bonusesUnreconciledDifference of 9,500.00 and no items at all.
2800Loan payableUnreconciledThe item is +7,500.00 and the difference is -7,500.00, so 15,000.00 is left over. The item was entered with the wrong sign.
2810Interest accruedUnreconciledOff by 1.01 with no items. One cent over the limit.
1900, 2900Suspense, Other liabilitiesNo supportThe support balance is blank.
1800GoodwillControl exceptionRavi Shah is both preparer and reviewer.
2910Customer refunds payableControl exceptionThe reviewer is blank.
1610, 2500Deposits paid, Customer depositsReconciled, aged itemsA reconciling item is 91 days old on 1610 and dated June on 2500.

Two details are easy to miss. The unknown-account item is printed on screen and is not in the output file, because the file has one row per account. And for the two no-support accounts, the difference and unexplained columns are blank.

Where to run it

A reconciliation check runs at close and again when a preparer fixes something. People need to run it themselves, see which accounts failed and why, and keep each month's output.

A script on a laptop does the first. The rest needs a place to run on a schedule, a login, and a copy of every result. A hosting service such as Vercel is one option. Nothing here was hosted.

If you would rather buy it

ChatFin's build or buy page says it runs on the ERP and version you already have, with no database credentials and no migration. We did not run this policy through ChatFin.

ChatFin also has pages titled Build an AI Agent for Balance Sheet Reconciliations and Build AI Agents for Account Reconciliation, Step by Step.

Test it before you trust it

1. Plant the answer and keep the key

We built the 24 accounts so that each status appears at least twice, and our reference code produced the expected answers. The key was not in Claude's folder. All 24 statuses and all the difference and unexplained amounts matched it.

Explained shows 0.00 where our key is blank, for the two no-support accounts. A second run, in a fresh session with the same two prompts answered in order, wrote a different 167-line script and matched on the same 24 accounts.

Made-up data. The key comes from our own reading of the policy, produced by the same code as the comparison in test 3, and the accounts were built to hit its edges. A match shows the script follows the written rules on these accounts. It says nothing about your ledger.

2. Try the edges of each rule

We ran 18 single-account files through Claude's script. The table groups them into ten rows.

Edge case results
What we sentWhat the script did
Unexplained of exactly 1.00 or -1.00; then 1.01 or -1.01Reconciled for the first two, unreconciled for the other two
A reconciling item exactly 90 days old, then 91 days oldReconciled for the first, "reconciled, aged items" for the second
An item dated 2 Nov, after the 31 Oct closeCounted as explained, no warning in the output file
An aged item on an account that is also unreconciled, or has a control exceptionThe earlier status wins. The aged item is not mentioned
Reviewer typed ravi shah in lower case with a trailing space, preparer Ravi ShahControl exception. The script treats them as the same person
A blank reviewer on an account that is unreconciledUnreconciled. The missing reviewer is not mentioned
Support balance of 0.00 and GL balance of 0.00Reconciled. A real zero is not the same as a blank
Blank support and blank reviewer; an item against an account with no supportNo support for both. The item does not change the status, and its amount still shows in the explained column
Item account typed 01 against account 1Item listed as belonging to an unknown account. Account 1 shows unreconciled
Duplicate account row, duplicate item_id, or an amount typed 2,000.00Stopped with a message that names the row. No output file

The script handled every boundary the policy states. What it does not do is tell you about problems the status order hides: an aged item on an unreconciled account, or a missing reviewer on an account with a large difference, never appears.

Claude flagged that gap in its plan and suggested a notes column. Our second prompt asked for five columns, so the script has no notes column.

3. Compare it with a second implementation

We wrote our own version of the rules and ran it on 2,000 random accounts, with up to three reconciling items each, differences of exactly 1.00 and 1.01 mixed in, same-person and blank reviewers, and items up to 200 days old.

Claude's script gave the same status on all 2,000: 529 unreconciled, 495 reconciled, 437 control exceptions, 426 with aged items and 113 with no support.

The generator and seed are in the edge folder. Our version is ours. The match shows the two readings agree, and both could be wrong.

4. Take the gaps to your controller

Items dated after the close, aged items hidden behind another status, the liability sign convention, items on accounts with no support, and what counts as the same person. Add your answers to the prompt and run the same files again.

Where ChatFin fits

The script shows how far two files and nine rules get you in a sitting. Around it you still need the feed that brings in the trial balance and the support, a place where reviewers sign off, and somebody to change the rules when the policy changes.

ChatFin's build or buy page lists the approval workflow and a full audit trail from prompt to prepared payload among what you get when you buy (Build vs Buy: Finance AI Agents in 2026).