Automating Financial Management with a CFO Agent
Invoicing, expense tracking, revenue reports, tax prep — all handled by an autonomous AI agent that runs on a schedule and reports back to me every morning.
When you're the only person in the company, finances are the thing you forget about. You're too busy writing code to remember that a subscription renews next week, or that your monthly burn rate just went up because you added a new service.
I don't have an accountant. I don't use QuickBooks. I built a system that tracks everything, runs automatically, and tells me when something needs attention.
The Source of Truth: A Spreadsheet
The whole thing starts with an Excel file. Two tabs: one for expenses, one for subscriptions. I edit it by hand when there's a new expense or subscription change.
That's it. No app, no Notion database, no fintech SaaS. When you have a handful of expenses per month, you don't need an ERP. You need a spreadsheet that opens instantly, works offline, and costs nothing.
The Sync Pipeline
A Python script called sync_finanze.py reads the Excel file and generates 5 JSON files. This is the bridge between human-editable data and machine-readable data.
expenses.json stores every recorded expense with fields for date, description, category, vendor, amount, VAT, total, project, and a recurring flag. Each expense gets tagged to a project so I can track costs per client.
subscriptions.json lists active subscriptions with renewal dates and notes. The notes field is important because it's where I annotate things like "temporary, cancel after project delivery" so the system can flag them accordingly.
projects.json contains per-project financials: how much each project has cost so far, how much revenue has come in, and how much is still pending. This is where I can see at a glance which projects are profitable.
dashboard.json holds aggregated KPIs: total expenses, monthly recurring costs, revenue received, revenue pending. It also includes renewal alerts for any subscription renewing in the next 30 days.
trends.json calculates burn rate and projections. Daily and monthly burn rates, plus a three-month projection of expenses vs. expected revenue.
The script runs, the JSONs update, and everything downstream picks them up automatically.
The Virtual CFO
A Claude Code agent configured as a virtual CFO. It's defined in a .md file with a role definition, permissions, and instructions, following the same pattern I use for all my agents.
The CFO reads all 5 JSON files and does what a finance person would do:
- Burn rate analysis to track how fast money is going out and whether it's accelerating or stable
- Runway calculation to determine how long current funds last at current spend rates
- Per-project P&L to see which projects are profitable and which are costing more than they bring in
- Anomaly detection for expenses growing unexpectedly, subscriptions renewing soon, late payments, and savings opportunities
- Trend analysis for month-over-month changes and seasonal patterns
The output is a structured markdown report. It also creates tasks in the shared task system when something needs action, like flagging an upcoming renewal or a late payment from a client.
One critical detail: the CFO agent is read-only. It can read files and run commands, but it cannot modify anything. It analyzes and produces output, and it never touches the data or the code. This is intentional. Agents that can both analyze and modify are agents you can't trust.
The Dashboard
SubraLabs has a local ops dashboard, a Node.js server running on localhost:4000. The finance section is one of its 7 pages.
The Finances page shows:
- KPI cards at the top with total expenses, monthly recurring costs, and annual projection
- Expense table with columns for Date, Description, Vendor, Category, Project, and Amount, grouped by month with subtotals
- Subscription cards with renewal dates and notes
The main Dashboard page has a bar chart showing expenses vs. revenue by month, plus an upcoming renewals section.
The entire thing runs locally, so the server costs nothing. The dashboard also has AI-powered features like a "Summarize with AI" button on reports, which uses the Claude API to generate quick summaries of lengthy financial analyses.
Scheduled Reports and the Task System
The CFO agent runs automatically every week via Cowork, Anthropic's desktop app for scheduling autonomous tasks. It produces a markdown report that lands in the ops dashboard, visible from the Reports page with a "Finanze" category filter.
Each report follows the same structure: executive summary, detailed analysis, alerts, and recommendations. The Reports page shows them chronologically with the ability to filter by category and search.
The task system is the bridge between analysis and action. When the CFO finds something that needs my attention, whether it's a renewal coming up, a payment that should have arrived, or an expense that seems off, it creates a task in tasks.json. The task shows up on the Dashboard page.
Here's the guardrail: only I can close tasks from the dashboard. Agents can create them, but they can't resolve them. This is deliberate. Agents flag issues and the human decides what to do. I don't want an AI marking a financial task as "done" because it thinks the situation resolved itself.
What This Costs: Nothing Extra
The whole finance system adds zero cost to my infrastructure. The sync script is plain Python. The dashboard is a local Node.js server. The AI runs on my existing Claude Max subscription.
Is the system overkill for a small number of expenses per month? Probably. But the pipeline doesn't care if there are 3 expenses or 300. When SubraLabs grows with more clients, more subscriptions, and more projects, the same system handles it. I just keep updating the spreadsheet.
And in the meantime, I never forget a renewal. No subscription charge surprises me, because the CFO already told me about it the week before.