# How to Install Claude Code Commands for AI Berkshire: A Complete Guide

> Install Claude Code commands for AI Berkshire effortlessly. Follow our complete guide to set up the xbtlin/ai-berkshire repository and integrate AI skills seamlessly.

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

---

**Run `npm install -g @anthropic-ai/claude-code`, clone the `xbtlin/ai-berkshire` repository, and execute [`./scripts/install-claude-commands.sh`](https://github.com/xbtlin/ai-berkshire/blob/main/./scripts/install-claude-commands.sh) to copy the markdown skill files into `$HOME/.claude/commands`.**

The **AI Berkshire** repository (`xbtlin/ai-berkshire`) provides a collection of financial analysis skills designed for Claude Code. To use these commands locally, you must install the Claude Code client and deploy the repository's markdown command files to the appropriate directory. This guide walks through the complete process to install Claude Code commands for AI Berkshire, from initial setup to verification.

## Prerequisites

Before installing, ensure you have **Node.js** and **npm** available on your system. The Claude Code client is distributed as an npm package and requires the `claude` binary to be accessible in your shell.

## Step-by-Step Installation Guide

### 1. Install the Claude Code Client

The Claude Code client is distributed as the `@anthropic-ai/claude-code` npm package. Installing it globally provides the `claude` binary that reads commands from `$HOME/.claude/commands`.

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

```

### 2. Clone the AI Berkshire Repository

Clone the repository to access the command definitions and the installation helper script.

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

```

### 3. Install the Command Files

Run the helper script [`scripts/install-claude-commands.sh`](https://github.com/xbtlin/ai-berkshire/blob/main/scripts/install-claude-commands.sh) to create the target directory and copy the markdown skill files.

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

```

This script performs three critical actions according to the source code: it creates the `$HOME/.claude/commands` directory (or the path specified by `CLAUDE_COMMANDS_DIR`), copies all `*.md` files from the `skills/` directory into it, and makes the utility scripts in `tools/` executable.

## Verifying Your Installation

Test the installation by invoking any AI Berkshire command through the Claude Code client:

```bash
claude /investment-research 腾讯
claude /news-pulse PDD
claude /portfolio-review "腾讯30%, 美团20%, 茅台20%, 现金30%"

```

If the commands execute without errors, AI Berkshire is successfully integrated with your Claude Code client.

## Customizing the Installation Directory

By default, the script installs commands to `$HOME/.claude/commands`. To use a custom location, export the `CLAUDE_COMMANDS_DIR` environment variable before running the installation script:

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

```

The Claude Code client will recognize commands from this alternate path as long as the variable is set in your environment.

## Understanding the Command Structure

The commands are plain markdown files stored in `skills/` (e.g., [`investment-research.md`](https://github.com/xbtlin/ai-berkshire/blob/main/investment-research.md), [`news-pulse.md`](https://github.com/xbtlin/ai-berkshire/blob/main/news-pulse.md)). These files are interpreted by the Claude Code client and version-controlled alongside the repository's Python utilities in `tools/`. When you update the repository by pulling the latest changes, you can rerun [`scripts/install-claude-commands.sh`](https://github.com/xbtlin/ai-berkshire/blob/main/scripts/install-claude-commands.sh) to sync your local commands with the latest versions.

## Summary

- **Install the client**: Run `npm install -g @anthropic-ai/claude-code` to get the `claude` binary.
- **Deploy commands**: Execute [`./scripts/install-claude-commands.sh`](https://github.com/xbtlin/ai-berkshire/blob/main/./scripts/install-claude-commands.sh) from the cloned repository to copy `skills/*.md` into `$HOME/.claude/commands`.
- **Customize paths**: Set `CLAUDE_COMMANDS_DIR` before installation to use a non-default directory.
- **Update easily**: Re-run the installation script after pulling repository updates to refresh your local commands.

## Frequently Asked Questions

### Where are the AI Berkshire command files stored?

The source markdown files are located in the `skills/` directory of the `xbtlin/ai-berkshire` repository. Each `*.md` file defines a specific command such as `/investment-research` or `/news-pulse`. The [`scripts/install-claude-commands.sh`](https://github.com/xbtlin/ai-berkshire/blob/main/scripts/install-claude-commands.sh) script copies these files to `$HOME/.claude/commands` during installation.

### What does the install script do besides copying files?

In addition to creating the target directory and copying markdown files from `skills/`, the [`scripts/install-claude-commands.sh`](https://github.com/xbtlin/ai-berkshire/blob/main/scripts/install-claude-commands.sh) script makes the utility scripts in `tools/` executable. These Python utilities, such as [`financial_rigor.py`](https://github.com/xbtlin/ai-berkshire/blob/main/financial_rigor.py), provide precise financial calculations required by the skills.

### Can I install the commands without using the provided script?

Yes, you can manually create `$HOME/.claude/commands` and copy the `*.md` files from `skills/` into it. However, using [`scripts/install-claude-commands.sh`](https://github.com/xbtlin/ai-berkshire/blob/main/scripts/install-claude-commands.sh) ensures that the `tools/` directory permissions are set correctly and handles directory creation automatically.

### How do I update Claude Code commands for AI Berkshire?

Navigate to your local repository clone and pull the latest changes, then rerun the installation script. This updates the markdown files in `skills/` and reinstalls them to the commands directory, ensuring you have the latest features and fixes.