Explain a Reclass in Flux Analysis With Claude
- JE-4133 6300 -32,750.00
- JE-4133 6310 +32,750.00
- JE-4140 6500 -14,200.00
- JE-4133 6300 to 6310
- amount 32,750.00
- JE-4140 is one line: not a reclass
- You need
- A month of journal lines and a trial balance, as CSV
- Tested with
- Claude Sonnet 5.5, made-up data, 5 Nov 2026
- Result
- 3 of 3 reclasses and 70 of 70 cells match, both runs
Three reclasses and four look-alikes
When JE-4133 moved 32,750.00 from Professional fees to Legal fees, Professional fees fell by 31,607.76 in September and Legal fees rose by 32,013.58.
The definition we tested: two sentences of the first prompt
I call an entry a reclass when it has exactly two lines in this file, on two different accounts, and the two amounts add up to zero. An entry that does not meet that is not a reclass, whatever its description says.
Our September file has 417 journal lines on 14 income statement accounts, and the lines add up to each account's September figure to the cent. The entry ids and figures are made up.
Input and output files
The script Claude wrote reads gl_detail_sep_2026.csv and trial_balance_activity.csv and writes reclasses.csv and account_facts.csv.
| Column | Used for |
|---|---|
entry_id, account, amount | Groups lines into entries and tests whether they cancel |
description, source, entered_by | Context for the paragraph. The definition ignores them |
aug_2026, sep_2026 | The change in each account |
The file holds income statement accounts only. The other side of JE-4140 is not in the file.
Ask Claude for a plan first
Attach both files and paste this. We do not publish the data, so your numbers will differ from ours.
I run the monthly flux review. I have two files: - trial_balance_activity.csv: 14 income statement accounts with their activity for Aug 2026, Sep 2026 and Sep 2025 (account, account_name, aug_2026, sep_2026, sep_2025). - gl_detail_sep_2026.csv: every September journal line on those accounts (entry_id, post_date, account, account_name, description, amount, source, entered_by). It holds income statement accounts only. The other side of an entry can sit on a balance sheet account that is not in the file. Some of the September movement is reclassifications, not real cost. I call an entry a reclass when it has exactly two lines in this file, on two different accounts, and the two amounts add up to zero. An entry that does not meet that is not a reclass, whatever its description says. I need the facts first, then a short paragraph for my controller on each reclass. Do not write code yet. Break the job into numbered steps. For each step say what could go wrong. Then list anything in my definition or my request that is unclear.
Run 1 and run 2 are two sessions given the same three prompts in the same order.
Both runs began by tying the journal lines to the trial balance, in step 1 or step 2 of eight. Both lists held the first five points below, and only run 2 listed the sixth:
- Whether "add up to zero" is exact to the cent. Both read it as exact, so an entry that misses by one cent is a near miss.
- Two lines on one account that cancel. Both said they fail the "two different accounts" test and would list them as excluded.
- One-line entries described as reclasses. Run 1 asked whether to list them as separate adjustments for the controller. Run 2 asked whether to list them as "not a reclass, but worth a question".
- The sign convention. Both assumed a positive amount is a debit.
- Which comparison matters, September against August or against September 2025. Both asked.
- Whether the paragraphs may give a reason. Only run 2 listed it. It said the only evidence of a reason is the description, and it would quote the description and write no cause.
Neither run asked whether each reclass gets one paragraph or two, so the third prompt below settles it: one paragraph under the account the amount left, and a one-sentence pointer under the account it reached.
Ask Claude to build it
Good. Use that plan. Write one Python script, standard library only, that reads both files and writes two files. reclasses.csv has one row per reclass: entry_id, from_account (the account with the negative line), to_account, amount (positive). account_facts.csv has one row per account in the trial balance: account, account_name, aug_2026, sep_2026, change (September minus August), reclass_net (the net of the account's reclass lines in September), change_without_reclass. Use exact decimal arithmetic. Never change my files. Run it, then show me the reclasses and every account whose reclass_net is not zero.
Claude Sonnet 5.5 (claude-sonnet-5-5) took the three prompts on 5 Nov 2026 as three turns of one Claude Code session with the files in a working folder, then again in a new session.
The first script is 139 lines of Python and the second is 63, standard library only with money as Decimal.
Both found the same three reclasses and the same figures for all 14 accounts, and both said they had compared checksums of our files before and after, which we did not verify.
| Entry | Moved | Amount | Change without it |
|---|---|---|---|
| JE-4127 | 6700 Travel to 6800 Events and sponsorship | 11,400.00 | 877.85 and -1,083.39 |
| JE-4133 | 6300 Professional fees to 6310 Legal fees | 32,750.00 | 1,142.24 and -736.42 |
| JE-4161 | 6210 Software subscriptions to 6220 Cloud hosting | 8,640.50 | -1,246.12 and 1,121.59 |
Without JE-4133 the changes in Professional fees and Legal fees are 1,142.24 and -736.42.
Now write reclass_review.md from the two CSV files only. For each reclass, write one paragraph under the heading of the account with the lower account number: it names the entry once, says which account the amount moved from and to, and gives each account's change with and without the reclass. Under the heading of the other account write one sentence that points to that paragraph and gives that account's change without the reclass. Do not describe a reclass as a cost increase or a saving. Every number and entry ID must come from the two CSV files. Then write check_review.py that tests the numbers and entry IDs in reclass_review.md against the two files, and run it.
Both runs wrote a six-section file of 199 and 200 words and a check script, and ran it. Run 1's paragraph under 6210 Software subscriptions reads:
Entry JE-4161 moved 8640.50 from 6210 Software subscriptions to 6220 Cloud hosting. Software subscriptions changed by -9886.62 as booked and by -1246.12 without the reclass. Cloud hosting changed by 9762.09 as booked and by 1121.59 without the reclass.
Under 6220 Cloud hosting it says: "See the paragraph under 6210 Software subscriptions. Cloud hosting changed by 1121.59 without the reclass." Run 2 words it differently, with thousands separators, and the figures are the same.
What the paragraphs leave out
Both runs named JE-4140, JE-4144, JE-4150 and JE-4155 in their chat reply, and neither review file mentions any of them.
| Entry | What it looks like | Effect |
|---|---|---|
| JE-4140 | One line, 6500 Freight out, -14,200.00. The description says reclass, and the file holds no other side | Freight out moved by -14,200.00 and stays in the change |
| JE-4144 | One line, 6400 Insurance, 6,300.00 | Insurance moved by 6,498.26 and stays in the change |
| JE-4150 | Two lines on 6900, -5,000.00 and 5,000.00 | Same account, so nothing moves between accounts |
| JE-4155 | 6710 -3,900.00 and 6700 3,500.00 | Adds up to -400.00, so it fails the zero test |
Checks: a key, 19 edge files, 3,000 random entries
1. A key kept out of the working folder
Our own code found the three reclasses and worked out the net on each account, and we kept the key out of the folder we told Claude to work in.
Both runs matched on the 3 reclass rows and on all 70 account cells (14 accounts, five columns). The two reviews contain all three entry ids once each, every reclass amount, and every without-reclass figure.
2. Edge cases
We ran 19 small journal files through both scripts.
| What we sent | What happened |
|---|---|
| Two lines, two accounts, adding to zero | A reclass. The description can say anything |
One line described as Reclass: to inventory | Not a reclass |
| Two lines adding to -0.01; two lines on one account; three lines adding to zero | None is a reclass |
| 500 and -500.0 typed with different decimals | A reclass of 500.00 in both runs |
| Lines of zero on two accounts | Both runs write a reclass of 0.00 |
| The positive line listed first | Same reclass. The from account is the one with the negative line |
| An entry id with a trailing space on one line | Run 1 sees two entries and finds nothing. Run 2 trims the id and finds the reclass |
| A reclass to an account that is not in the trial balance | Run 1 writes reclasses.csv, then stops with no account_facts.csv. Run 2 carries on and writes facts for the known account only, so its reclass nets no longer add up to zero |
An amount typed 1,000.00 or left blank | Both stop with a Python error that does not name the line |
3. Six broken reviews
Both runs wrote a check that tests the review against the two CSV files. We changed each review six ways and ran its own check on the broken copy.
| What we changed | What the check did |
|---|---|
| Swap the from and to accounts in one paragraph | Caught by both checks |
| Swap two amounts between entries | Caught by both checks |
| Call JE-4140 a reclass | Caught by both checks |
| Add a cause the files do not show, "because the audit fee was coded to the wrong account", inside the direction phrase of one paragraph | Run 1 failed it. Run 2 passed it |
| Add the sentence "The entry was coded to the wrong account." at the end of that paragraph | Both checks passed it |
| Add the same sentence at the start of that paragraph | Both checks passed it |
Run 1's check passed an unbroken review with 72 checks. It caught the cause we put inside the direction phrase, because it looks for that phrase whole.
It passed the same cause as a separate sentence. Run 2's check also tests the headings, the direction text and the pointer sentences, and it passed both versions of the cause.
4. 3,000 random entries against our own definition
We made 3,000 random entries: two-line reclasses, same-account pairs, near misses of one cent, three-line entries, single lines, and two lines that do not cancel. 807 meet the definition.
Both scripts found exactly those, with the right accounts and amounts, and the right net on every account. The 3,000 entries and the expected answers both come from our own definition, so a wrong reading of the definition would pass.