This weekend I did something which has nothing to do with law.
I built an automated morning briefing for my personal share portfolio, stitching together a free brokerage app, GitHub, n8n, Yahoo Finance, and Claude's API.
Why does this matter for UK lawyers? Well, arguably it doesn’t… at least directly. I'm writing it up here because the pattern I used is the same one you'd use to automate a weekly case review or a compliance digest, or dozens of professional workflows. More on that below.
The whole thing took a morning (with a fair amount of back and forth with Claude itself to debug it), costs under £30 a month to run, and now lands in my inbox at 08:00 every weekday with a performance summary, live prices, and trade ideas. I did this on a plane for a short(ish) flight.
If you can do it with a share portfolio, you can do it with a case list, a compliance register, or a client pipeline.
The problem
I use Freetrade, a commission-free brokerage app popular in the UK. It is perfectly good for buying and holding, but its analytical tools are limited. I wanted a daily briefing that would tell me how my positions were performing, flag anything worth acting on, and suggest rebalancing ideas, all without me having to open multiple tabs and do mental arithmetic before breakfast. I also wanted to flag recent news that may affect any of my holdings.
What I built
The system has four moving parts.
Freetrade to GitHub. Freetrade lets you export your full activity history as a CSV. I push that file to a private GitHub repository. A GitHub Actions workflow fires automatically, runs a Python script that calculates my current holdings using pooled average cost, and writes a clean
holdings.csv. The input file gets archived with a timestamp. This step is entirely deterministic: same input, same output, every time.n8n for orchestration. n8n is a workflow automation tool (think Zapier, but self-hostable and with a proper code node). I use their cloud offering for now but may switch to self hosting in future. A cron trigger fires at 08:00 on weekdays. Three parallel branches fetch my holdings CSV from GitHub, fetch the build status metadata, and pull live prices from Yahoo Finance for each ticker plus the GBP/USD exchange rate. A merge node waits for all three branches to finish before anything else runs.
Claude for analysis. A code node assembles everything (holdings, live prices, any price fetch failures) into a single prompt and sends it to the Claude API. The prompt includes some hard rules tailored to my personal preferences of what I would and would not like to invest in. It suggests a maximum six trade ideas per briefing, and any sale must include a reinvestment plan allocating 100% of proceeds, and medium risk tolerance optimising for one to three month capital growth. Claude returns a structured markdown report.
Email delivery. Another code node converts Claude's markdown into styled HTML (with proper tables, colour-coded gains and losses, inline CSS for email client compatibility) and Gmail sends it to my inbox.
What the briefing looks like
The email arrives with a holdings performance table showing each position's current price, cost basis, gain or loss in both percentage and absolute terms, and portfolio weight. Below that: a market context section, individual stock commentary, up to six trade ideas with rationale, and a risk assessment. If any price failed to fetch (Yahoo's unofficial API is not bulletproof), the briefing says so explicitly rather than silently using stale data.
What went wrong along the way
Quite a lot, which is partly the point but these were the two key issues I found:
Freetrade quietly renamed two columns in their CSV export sometime in early 2026. "Total Shares Amount" became "Total Amount in Instrument Currency" and "Total Amount" became "Total Amount in Account Currency". This caused my GitHub Actions to fail with a cryptic missing-column error. The fix was a simple alias map in the Python script, but it took a few minutes of staring at CSV headers to work out what had changed.
The n8n workflow had a race condition. Three parallel branches fed into a code node, but the code node fired as soon as the first branch delivered its data, before the price fetches had finished. The fix was inserting a merge node in append mode with three inputs, which forces n8n to wait for all branches before proceeding.
The cost
The monthly running cost breaks down as follows: n8n Cloud Starter at roughly €24, Claude API usage (one Sonnet call per weekday) at roughly £1 to £2, Yahoo Finance at zero (it is an unofficial endpoint, so no guarantees), and GitHub Actions at zero for a public repository.
That comes to under £30 a month for a daily AI-powered portfolio briefing. For context, a basic subscription to a retail investment research platform typically costs more than that, and this one is tailored to my exact holdings and risk preferences.
More after the break…
Ad Break
In order to help cover the running costs of this newsletter, please check out the advert below. In line with my promises from the start, adverts will always be declared and actual products that I have tried, with some brief thoughts from me.
Want to get the most out of ChatGPT?
ChatGPT is a superpower if you know how to use it correctly.
Discover how HubSpot's guide to AI can elevate both your productivity and creativity to get more things done.
Learn to automate tasks, enhance decision-making, and foster innovation with the power of AI.
Why this matters beyond share portfolios
The architecture here is generic. You have:
a data source (CSV export);
a transformation step (Python script on GitHub Actions);
an orchestration layer (n8n);
an LLM for analysis (Claude API);
and a delivery channel (email).
Swap the components and you have the same pattern for a weekly case review that pulls data from your practice management system, a monthly compliance digest that reads your complaints register, a daily news briefing filtered to your practice areas, or an automated client update that summarises recent activity on their matter.
The barrier to building these things has dropped considerably. I am not a developer. I am a solicitor who can read documentation and is willing to debug error messages. The combination of n8n's visual workflow builder and Claude's ability to help troubleshoot its own integration (I used Claude throughout the build process, including to write and fix the Python script, draft the n8n node configurations, and diagnose every error listed above) meant that the whole project went from idea to working prototype in a single morning.
A word of caution
This is a personal tool for a personal portfolio. I would not use it, or anything like it, to give advice to clients.
The goal is to simply aggregate information I have available, and deliver that to me in a concise briefing.
The trade ideas are suggestions from an LLM working with limited context, not recommendations from a regulated adviser. The live pricing comes from an unofficial API that could stop working tomorrow. And the "hard rules" embedded in the prompt are a reminder that the system does what you tell it to, not necessarily what is rational.
I don't simply execute trades it suggests but rather use it as a morning reminder of what might have moved and to consider my options.
As an exercise in understanding what is possible with current tools, and as a genuinely useful addition to my morning routine, it has been well worth the time.
How did we do?
This story is the start of my “Off Topic” series (see tags to this post), which will be used for stories that are less directly related to legal AI and allow me to offer general thoughts on AI, project building and other musings.
If it is of use to people, I am happy to share the keys files (like the prompts, n8n jsons etc) if there is interest, via Github.
Thanks for reading,
Serhan, UK Legal AI Brief
Serhan Handani is a solicitor and the editor of the UK Legal AI Brief.
Disclaimer
Guidance and news only. Not legal advice. Always use AI tools safely and in line with best practice.

