# How to Configure AI-Berkshire for Claude Integration: A Complete Setup Guide

> Learn how to configure AI-Berkshire for Claude integration. Follow our complete setup guide to deploy 18 investment-research skills into Claude's command directory. Get started now.

- Repository: [Xbt Lin/ai-berkshire](https://github.com/xbtlin/ai-berkshire)
- Tags: how-to-guide
- Published: 2026-07-01

---

**To configure AI-Berkshire for Claude integration, install the Claude Code npm package, clone the repository, and execute [`./scripts/install-claude-commands.sh`](https://github.com/xbtlin/ai-berkshire/blob/main/./scripts/install-claude-commands.sh) to deploy the 18 investment-research skills into Claude's command directory.**

AI-Berkshire is an open-source framework that brings Berkshire Hathaway-style investment analysis to Claude Code. Configuring the repository for Claude integration transforms a standard Claude session into a comprehensive research terminal, enabling slash-commands like `/investment-research` and `/news-pulse` that orchestrate multi-agent financial analysis workflows.

## Prerequisites

Before configuring AI-Berkshire for Claude integration, verify you have:

- **Node.js and npm** installed on your system
- **Bash shell** for executing the installation scripts
- **Git** to clone the repository

The Claude Code client requires npm for global installation, while the skill deployment relies on standard Unix file operations available in any modern terminal.

## Step-by-Step Configuration

Configuring AI-Berkshire involves three sequential phases: installing the Claude runtime, obtaining the source code, and deploying the skill definitions to Claude's global commands folder.

### Install the Claude Code Client

The Claude Code client is a lightweight npm package that enables slash-command interpretation within Claude sessions.

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

```

This command registers the `claude` binary in your `$PATH`, allowing you to launch Claude from any terminal directory.

### Clone the AI-Berkshire Repository

Clone the official repository to access the skill definitions and helper scripts.

```bash
git clone https://github.com/xbtlin/ai-berkshire.git
cd ai-berkshire

```

The repository contains the `skills/` directory with 18 Markdown-based skill definitions and the `tools/` directory containing Python utilities like [`financial_rigor.py`](https://github.com/xbtlin/ai-berkshire/blob/main/financial_rigor.py).

### Deploy Skill Definitions

Execute the installation script to copy all skill files into Claude's commands directory.

```bash
./scripts/install-claude-commands.sh

```

This script performs three critical operations:

1. **Sets the destination path** using `DEST="${CLAUDE_COMMANDS_DIR:-$HOME/.claude/commands}"` (defaulting to `~/.claude/commands`)
2. **Copies skill files** via `cp "$ROOT"/skills/*.md "$DEST"/`—this transfers all 18 research skills including [`investment-research.md`](https://github.com/xbtlin/ai-berkshire/blob/main/investment-research.md) and [`news-pulse.md`](https://github.com/xbtlin/ai-berkshire/blob/main/news-pulse.md)
3. **Makes tools executable** using `chmod +x "$ROOT"/tools/*.py "$ROOT"/tools/*.sh`, ensuring helper scripts like [`financial_rigor.py`](https://github.com/xbtlin/ai-berkshire/blob/main/financial_rigor.py) can run when invoked by Claude agents

After execution, you will see confirmation that commands are installed to your Claude commands directory.

### Optional: Custom Command Directory

To configure AI-Berkshire for Claude integration with a non-standard commands location, set the `CLAUDE_COMMANDS_DIR` environment variable before running the installer.

```bash
export CLAUDE_COMMANDS_DIR=$HOME/.my-claude-commands
./scripts/install-claude-commands.sh

```

This override is useful for containerized environments or when managing multiple Claude command profiles. The script logic at line 5 of [`install-claude-commands.sh`](https://github.com/xbtlin/ai-berkshire/blob/main/install-claude-commands.sh) explicitly checks for this variable before defaulting to `$HOME/.claude/commands`.

## Understanding the Architecture

AI-Berkshire employs a three-layer architecture that executes when you invoke a slash-command:

**Skill Layer** — The Markdown files in `skills/` (e.g., [`investment-research.md`](https://github.com/xbtlin/ai-berkshire/blob/main/investment-research.md)) define the command signature and orchestration logic. When you type `/investment-research`, Claude reads the corresponding file to understand the workflow.

**Agent Layer** — Each skill spawns four parallel Claude agents representing investment masters (段永平, 巴菲特, 芒格, 李录). These agents simultaneously analyze the target company using different strategic frameworks.

**Tool Layer** — Python scripts in `tools/` (particularly [`financial_rigor.py`](https://github.com/xbtlin/ai-berkshire/blob/main/financial_rigor.py)) handle precise calculations, market-cap verification, and cross-source data validation. The tool layer ensures numerical accuracy across all agent analyses.

This architecture is purely declarative; the only executable installation artifact is the Bash script—everything else operates through Claude's natural language processing and Python tool invocation.

## Usage Examples

Once you configure AI-Berkshire for Claude integration, you can immediately execute complex research workflows.

### Running Investment Research

To analyze a company using the full agent ensemble:

```text
/investment-research 腾讯

```

This triggers the following execution chain:

1. Claude loads [`skills/investment-research.md`](https://github.com/xbtlin/ai-berkshire/blob/main/skills/investment-research.md) and parses the command structure
2. Four parallel agents initialize, each invoking [`tools/financial_rigor.py`](https://github.com/xbtlin/ai-berkshire/blob/main/tools/financial_rigor.py) to fetch financial data
3. Each agent applies its specific investment philosophy (value investing, margin of safety, etc.)
4. A "Team Lead" agent synthesizes the four perspectives into a structured Markdown report

The command supports any publicly traded company ticker or Chinese company name (e.g., `腾讯` for Tencent).

### Skipping Permission Prompts

For trusted environments where you want to streamline the workflow, launch Claude with the `--dangerously-skip-permissions` flag documented in [`CLAUDE.md`](https://github.com/xbtlin/ai-berkshire/blob/main/CLAUDE.md).

```bash
claude --dangerously-skip-permissions

```

**Warning:** This disables Claude's built-in tool-approval safety gate. Use only in isolated, trusted environments where you have verified the safety of the `tools/` scripts.

## Key Files and Their Roles

Understanding these specific files helps troubleshoot or customize your AI-Berkshire configuration:

| File Path | Purpose |
|-----------|---------|
| [`scripts/install-claude-commands.sh`](https://github.com/xbtlin/ai-berkshire/blob/main/scripts/install-claude-commands.sh) | Bash installer that handles the `CLAUDE_COMMANDS_DIR` logic and file copying operations |
| [`CLAUDE.md`](https://github.com/xbtlin/ai-berkshire/blob/main/CLAUDE.md) | User guide containing installation instructions and the `--dangerously-skip-permissions` documentation |
| [`skills/investment-research.md`](https://github.com/xbtlin/ai-berkshire/blob/main/skills/investment-research.md) | Primary skill definition for comprehensive equity research with four-agent orchestration |
| [`tools/financial_rigor.py`](https://github.com/xbtlin/ai-berkshire/blob/main/tools/financial_rigor.py) | Core Python utility for decimal-precision calculations and data validation used across multiple skills |
| [`skills/news-pulse.md`](https://github.com/xbtlin/ai-berkshire/blob/main/skills/news-pulse.md) | Secondary skill for real-time news sentiment analysis |

## Summary

- **Install the client** using `npm install -g @anthropic-ai/claude-code` to enable slash-command support
- **Run the installer** [`./scripts/install-claude-commands.sh`](https://github.com/xbtlin/ai-berkshire/blob/main/./scripts/install-claude-commands.sh) to copy all 18 skill files from `skills/` to `~/.claude/commands`
- **Customize the path** by setting `CLAUDE_COMMANDS_DIR` before running the installer for non-standard deployments
- **Execute research** by typing `/investment-research [company]` to trigger the four-agent analysis workflow
- **Skip permissions** with `claude --dangerously-skip-permissions` only in trusted, isolated environments

## Frequently Asked Questions

### Where does the install script copy the AI-Berkshire skill files?

By default, [`./scripts/install-claude-commands.sh`](https://github.com/xbtlin/ai-berkshire/blob/main/./scripts/install-claude-commands.sh) copies all `*.md` files from the `skills/` directory to `$HOME/.claude/commands`. You can override this destination by setting the `CLAUDE_COMMANDS_DIR` environment variable before execution.

### What should I do if the Claude commands are not recognized after installation?

Verify that the files exist in your Claude commands directory by listing `~/.claude/commands/*.md`. Ensure you restarted your Claude session after installation, as Claude only loads command definitions at startup. If using a custom path, confirm that `CLAUDE_COMMANDS_DIR` points to the correct location.

### Is it safe to use the `--dangerously-skip-permissions` flag?

Only use `--dangerously-skip-permissions` in trusted, isolated environments where you have audited the Python scripts in `tools/`, particularly [`financial_rigor.py`](https://github.com/xbtlin/ai-berkshire/blob/main/financial_rigor.py). This flag disables Claude's safety gate that prompts you before executing tool calls, which streamlines workflows but removes the approval checkpoint for Python code execution.

### How do I update AI-Berkshire to the latest version?

Pull the latest changes from the xbtlin/ai-berkshire repository using `git pull`, then re-run [`./scripts/install-claude-commands.sh`](https://github.com/xbtlin/ai-berkshire/blob/main/./scripts/install-claude-commands.sh). The script will overwrite existing skill files in your Claude commands directory with the updated versions.