Lecture 05 · Practical

Business Valuation — an agentic exercise

You type one command, and a small team of AI agents values a real public company — pulling its filings from the SEC, running a discounted-cash-flow model, finding comparable companies, reading the risk factors, and reconciling it all into a fair-value range that it then checks against the live market price.

The one rule that makes it trustworthy: the LLM reads, reasons, and chooses inputs — but it never does the arithmetic. Every number you see comes from a small Python tool. The agents decide what to compute; the code decides how much it is.

The big idea

A company's value is uncertain, so instead of one number we produce a range. Three independent "lanes" each estimate the value a different way, and a final agent blends them and benchmarks the result against what the market is actually paying today.

  1. Get the data. Download the company's latest annual report (10-K) and its financial figures straight from the SEC — no paid data feeds.
  2. Three ways to value it, at once. A discounted-cash-flow model, a comparison to peer companies, and a read of the qualitative risks — run in parallel.
  3. Reconcile. Blend the three into a single fair value plus a P10–P90 range, then compare it to the real market price to see if the company looks over- or under-valued.
  4. Show the work. Every step is recorded and turned into an interactive report you can read afterwards.

How to run it

Open this folder in Claude Code and type one command with a ticker or SEC ID:

/valuation AAPL # or any ticker, or a CIK like 320193
🔑

One-time setup. The SEC asks everyone who downloads filings to identify themselves. Copy .claude/settings.local.json.example to .claude/settings.local.json and put your name and email inside. It stays on your machine — see the README.md for the exact steps.

The agents — who does what

Each agent is a specialist with one job. They don't step on each other: the data agent runs first, the three valuation agents work in parallel, and the reconciliation agent brings it together at the end.

📄 EDGAR analyst

Finds the company on the SEC, downloads its filings, and tidies the raw numbers into a clean sheet the others rely on. It never guesses a figure — only reports what's filed.

📈 DCF analyst

Runs the discounted-cash-flow model. It chooses sensible assumptions (growth, margins, discount rate) and lets the tool simulate thousands of scenarios to get a value range.

⚖️ Comps analyst

Finds comparable companies two ways — from its own knowledge, and by matching the language of their annual reports — then values the target off what those peers trade for.

📝 Qualitative analyst

Reads the story behind the numbers: competitive risks, regulation, and one-time items that distort the accounts. It turns that reading into guidance the other lanes can use.

🧮 Reconciliation analyst

Blends the three lanes into one fair-value range, compares it to the live market price, and writes the final reports. It flags valuations that are too uncertain to trust.

The skill — the single command

A "skill" is a saved workflow you trigger by name. This project has one, and it's the whole exercise: it wires the agents together in the right order.

Skill /valuation <ticker | CIK>

Fetches the data, launches the three valuation lanes in parallel, reconciles them, and produces the reports — end to end, from one line.

Hooks & the timeline

A "hook" is a small script that runs automatically around every action an agent takes. This project uses one to keep an honest record of the run.

Hook Activity recorder

Before and after every tool or agent step, the hook quietly notes what happened — which agent, which command, how long it took, and what came back — into a log file.

➡️ Why it matters

That log becomes the timeline in the final report: a color-coded, step-by-step replay of how the fleet reached its answer. Great for understanding — and for debugging.

The tools — where the math actually happens

These are plain Python scripts in the tools/ folder. The agents call them; the scripts do every calculation. You can also run any of them by hand to see what it does.

What you get out

Two reports land in the reports/ folder each run:

📄 A short summary

A plain .md file with the headline fair value, the range, the market gap, and the reasoning — easy to skim or paste into notes.

🖥️ An interactive page

An .html report you open in any browser: the fair-value range against the live price, the WACC × growth sensitivity heatmap, and the full agent timeline.

🎓

The point of the exercise isn't to trust the final number — it's to see how a team of agents can automate a real analyst workflow, where each figure is traceable and the computer, not the language model, does the arithmetic.