Skip to content

← back

Funds Flow Audit Tool

PE deal closing audit automation

What it does

  • Parses the client's funds flow Excel and extracts every line item from the in-scope tabs (skips seller / wire / summary tabs automatically).
  • Extracts the full text from every supporting PDF in the documents folder (invoices, confirmations, wire instructions, whatever the client sent).
  • Matches each funds-flow line to its supporting document using Claude's in-context reasoning, and assigns a GL account from chart_of_accounts.json at the same time.
  • Classifies every match as MATCHED (amount agrees), CUMULATIVE (multiple invoices sum to the line), PARTIAL (amount short), or MISSING, and moves orphan documents to an UNMATCHED/ folder.
  • Writes an annotated workpaper with audit columns, a Journal Entry tab, and PDF snapshot tabs, then renames the source PDFs with FF-numbered prefixes (FF01 - Vendor - INV-001.pdf) for clean filing.

Why I built it

Having spent years in private equity accounting and external audit, I had reviewed legal documents for countless hours: funds flow, closing binders, fee schedules, side letters. The boring 80% of that work (parsing, extracting terms, tying amounts) was data work. The interesting 20% (does this fee belong here, is this the right GL, does this party tie to the agreement) was judgment. Most AI-for-audit tools push everything through an LLM and produce workpapers a senior cannot review. I wanted to prove you can do this the way audit actually works: deterministic scripts do the mechanical work, Claude does the judgment, and the output is a workpaper a reviewer can foot in Excel.

How it works

Funds flow PDFPython (deterministic)Claude (judgment)Parse + normalizeextract_funds_flow.pyFoot + formatwrite_outputs.pyGL classificationprofessional skepticismDocument matchingin-context reasoningAnnotated workpaper
Two parallel lanes. Python handles anything with a right answer. Claude handles anything that needs judgment. They merge into one auditor-reviewable workpaper.

What was hard

  • Drawing the line between Python and Claude. Anything with a deterministic right answer (parsing amounts, tying totals, writing formulas) belongs in Python, because putting it in the LLM makes the workpaper non-reproducible. Anything that needs judgment (does this fee classify here, is this a related-party cost) needs Claude. Mixing the two in one step was the fastest way to lose the audit trail.
  • Producing output a reviewing senior can actually audit. The workpaper had to be reviewable with Excel and a PDF viewer, no special tooling, otherwise nobody would use it. That meant formula-linked cells, a cross-referenced Journal Entry tab, and FF-numbered document renames so every line has a citation.
  • Handling cumulative matches and partials cleanly. One line in the funds flow often maps to an interim invoice plus a final bill, or to a net wire of a larger invoice. The matcher had to surface CUMULATIVE and PARTIAL statuses distinctly, not force everything to MATCHED or MISSING.
  • Keeping the evidence trail tight. Every Claude classification needs a citation back to the source document. If the LLM says "this is a legal fee," the workpaper has to show which PDF and which page led to that call.

Outcome

  • An annotated workpaper where every funds-flow line shows its match status, the supporting document it ties to, and the GL code.
  • A Journal Entry tab built into the workpaper so a reviewer can post straight from the file.
  • A clean, auditor-ready document pack with every supporting PDF renumbered and cross-referenced to the workpaper.
  • Review time on a real closing dropped from hours to minutes.

Tech

Claude Code · Python · Excel · PDF parsing · MCP