# AI Berkshire

> Value-investing research skills for Claude Code and Codex, built on four investors' methods and parallel agents

- Category: Agents & Automation / Finance & Market Agents
- Language: Markdown, Python
- Licence: MIT
- Repository: https://github.com/xbtlin/ai-berkshire
- Canonical page: https://ai-tldr.dev/tools/ai-berkshire/

## In short

AI Berkshire is a collection of investment-research skills that installs into Claude Code as slash commands and into Codex as skills. It sits in the Finance & Market Agents category of the Agents & Automation tools and is open-source, written in Markdown, Python and licensed MIT. To get started: install an AI client.

## Overview

AI Berkshire is a collection of investment-research skills that installs into Claude Code as slash commands and into Codex as skills. It turns the methods of four value investors — Warren Buffett, Charlie Munger, Duan Yongping and Li Lu — into structured workflows, so a prompt such as `/investment-research Tencent` runs a fixed sequence of modules instead of producing a free-form answer. The repository ships 21 skills, grouped into deep research, earnings analysis, industry screening, portfolio management and thinking tools.

The design has three layers. The skill layer is the entry point you pick by scenario. Team skills such as `/investment-team` and `/earnings-team` add an agent layer: a Team Lead launches four agents in parallel, one per investor's lens (business model, valuation, competition and inversion, long-term risk and management), each doing its own web searches before the lead synthesizes and the agents cross-examine each other. The tool layer underneath handles exact arithmetic, live search and report auditing; lightweight skills skip the agents and call those tools directly.

The project is opinionated about output. Skills are written to force a verdict — pass, fail or gray zone, with price ranges and tiered recommendations — and to apply checks such as an A/B/C information-richness rating, a Munger-style inversion test, a quick-kill checklist and a five-sentence "mirror test". Numbers go through `tools/financial_rigor.py`, which uses Python's `decimal.Decimal` rather than floats. The README notes that deep-research skills consume many tokens and recommends screening first. It is for education and research only and is not investment advice.

## What it does

- 21 slash-command skills covering single-company research, private companies, earnings reviews, industry value-chain scans, funnel screening, portfolio review, thesis tracking and price-move attribution
- Four-master analysis: Duan Yongping on business quality, Buffett on moat and valuation, Munger on inversion and risk, Li Lu on long-term certainty, designed to disagree with each other
- Multi-agent team skills (`/investment-team`, `/earnings-team`) that run four independent research agents in parallel under a Team Lead
- `financial_rigor.py` for exact-decimal market-cap and valuation checks, multi-source cross-validation, three-scenario targets and Benford's-law anomaly detection
- One canonical skill source for both clients: `skills/*.md` for Claude Code, with Codex skill packages and optional Codex slash prompts generated from it

## Getting started

You need Claude Code or Codex installed first. The repository's install scripts copy the skills into the client's global directory; Windows `.bat` equivalents are included.

1. Install an AI client

   Install Claude Code with npm (Codex users can run `npm install -g @openai/codex` instead).

```bash
npm install -g @anthropic-ai/claude-code
```

2. Install the skills for Claude Code

```bash
git clone https://github.com/xbtlin/ai-berkshire.git
cd ai-berkshire
./scripts/install-claude-commands.sh
```

3. Or install them for Codex

   From the same clone, this generates Codex skills into `~/.codex/skills`; the second script optionally adds slash prompts to `~/.codex/prompts`.

```bash
cd ai-berkshire
./scripts/install-codex-skills.sh
./scripts/install-codex-prompts.sh
```

4. Run a skill

   Invoke skills directly in Claude Code. In Codex, restart it and ask by name, e.g. "Use investment-research to research Tencent".

```bash
/quality-screen Hang Seng Index Constituents
/investment-research Tencent
/investment-team Meituan
/news-pulse Tencent
```

## When to use it

- Run a full four-perspective research report on a listed company, ending in a pass / fail / gray-zone verdict with price ranges
- Screen a whole index or theme cheaply with `/quality-screen` or `/investment-checklist` before spending tokens on deep research
- Read an earnings release from primary filings only with `/earnings-review`, or have a team of agents turn it into an article
- Track whether an existing holding's thesis still holds, or explain a sudden price move in minutes with `/news-pulse`
