Claude Code for Automating Intercompany Reconciliation

Intercompany reconciliation is one of the most persistent bottlenecks in the monthly close. Every legal entity in a group trades with every other entity, and each transaction creates a mirror-image pair of entries: an intercompany receivable in one set of books and an intercompany payable in another. In theory, these should offset perfectly. In practice, they almost never do. Differences creep in through FX rate timing, goods-in-transit that one entity has invoiced and the other has not, intercompany profit sitting in inventory, misapplied journal entries, and simple data entry errors. Controllers at multi-entity organizations routinely spend three to seven days per close chasing these mismatches across spreadsheets, ERP extracts, and email threads.

The cost of this friction is not just time. Unreconciled intercompany balances distort consolidated financials, delay reporting to the board, create audit findings, and — in jurisdictions with transfer pricing scrutiny — can trigger uncomfortable questions from tax authorities. Most teams have a process, but the process usually lives in one person’s head and a folder of Excel files named “IC_Rec_FINAL_v7_USE_THIS.xlsx.”

Claude Code changes the economics of this work. Unlike a chat interface, Claude Code reads and writes files directly, executes scripts, and iterates on its own output. You point it at your intercompany data extracts, your entity master list, and your matching rules, and it builds the reconciliation logic, runs it, flags exceptions, and produces the documentation trail — all in a repeatable, version-controlled way. What used to be a manual grind becomes a scripted pipeline you can rerun in minutes every close.

Where to Start: Two Prompts That Do the Heavy Lifting

The temptation with any AI tool is to ask it to “reconcile my intercompany balances” and hope for the best. That fails for the same reason vague instructions fail with junior staff: the tool has no idea what your tolerance thresholds are, which entities are in scope, or what a “good” output looks like. The two prompts below are structured to eliminate that ambiguity. The first builds the matching engine. The second turns the exceptions into a review-ready report for entity controllers.

Both prompts follow the same anatomy: a clear task, a success definition, mandatory file reading before execution, a reference example, and an explicit instruction to plan before acting. This structure is not decorative. It forces Claude Code to ground itself in your data and standards before writing a single line of logic, which dramatically reduces rework.

I want to build a Python-based intercompany reconciliation script so that I can match IC receivable and payable balances across all entities in my group and isolate only the true exceptions.

First, read these files completely before responding:
[ic_balances_extract.csv] — the raw intercompany balance extract with columns: entity_id, counterparty_id, account_type, currency, amount_local, amount_group, transaction_date, reference
[entity_master.md] — the list of legal entities, their functional currencies, and which entities are in scope for this close
[matching_rules.md] — my existing tolerance thresholds, FX rate sources, and timing cutoffs

Here is a reference for what I want to achieve:
[Upload an example of a prior reconciliation output as markdown, showing matched pairs, unmatched items, and the variance column]

Here’s what makes this reference work:
It pairs each receivable with its counterparty payable, shows the variance in group currency, and separates timing differences from genuine mismatches. Every exception row has a reason code. Nothing is silently dropped.

Here’s what I need for my version / SUCCESS BRIEF:
Type of output + length: A working Python script plus a matched/unmatched output CSV
Recipient’s reaction: The controller should be able to run it and trust the results without re-checking the logic
Does NOT sound like: A black-box script with no logging or reason codes
Success means: 95%+ of balances auto-match, and every unmatched item has a documented reason

My context file contains my standards, constraints, audience. Read it fully before starting.
DO NOT start executing yet. Ask clarifying questions first.

Give me your execution plan (5 steps max) before you begin.

Notice what the prompt does not do: it does not ask Claude Code to guess your tolerance. It supplies the rules file and requires the tool to read it first. It also demands a reason code for every exception, which is the single most important design choice in any reconciliation pipeline. A mismatch without a reason is just a mystery with a row number.

Once the matching engine works, the second prompt handles the human side of the process. Entity controllers do not want a raw CSV of unmatched rows. They want to know what they need to fix, why it happened, and what the impact is in group currency. That is a different output with a different audience, and it deserves its own prompt.

I want to generate a per-entity exception report from my reconciliation output so that each entity controller receives only their own unmatched items with a clear action to take.

First, read these files completely before responding:
[ic_unmatched_output.csv] — the exception rows produced by the reconciliation script, including reason codes and variances
[entity_contacts.md] — entity IDs mapped to controller names, emails, and reporting currency
[escalation_policy.md] — my rules for which variance thresholds require controller action versus group-level review

Here is a reference for what I want to achieve:
[Upload a sample exception memo from a prior close as markdown]

Here’s what makes this reference work:
It opens with the total variance in group currency, lists each unmatched item with the counterparty and amount, states the likely cause in plain language, and ends with a specific action and deadline. It is short, factual, and never blames the recipient.

Here’s what I need for my version / SUCCESS BRIEF:
Type of output + length: One markdown memo per entity, 250-400 words each
Recipient’s reaction: The controller should know exactly what to fix and by when, without needing to ask follow-up questions
Does NOT sound like: A generic system notification or a blame-oriented message
Success means: Fewer than 10% of memos generate a clarifying question back to the group team

My context file contains my standards, constraints, audience. Read it fully before starting.
DO NOT start executing yet. Ask clarifying questions first.

Give me your execution plan (5 steps max) before you begin.

The practical tip that matters most here: run these prompts against a closed prior period first. You already know the correct answer for last month, so you can validate the matching logic and the memo tone against a known outcome before you trust it on live data. Once the pipeline proves itself on a closed period, it becomes a permanent asset — version it in your repository, document the reason codes, and rerun it every close.

From there, the natural next step is to extend the same approach to adjacent close tasks: intercompany profit elimination, FX translation checks, and consolidation tie-outs. Each one follows the same pattern — structured prompt, mandatory file reading, reference example, success brief — and each one removes another manual bottleneck from the close calendar.

Published on 2 October 2026 on growwithgpt.com