How to Install AI Berkshire for Claude Code

Install AI Berkshire for Claude Code by running the scripts/install-claude-commands.sh helper script after cloning the repository, which copies markdown skill files from the skills/ directory to $HOME/.claude/commands and makes utility scripts in tools/ executable.

AI Berkshire provides investment analysis capabilities through Claude Code commands. The xbtlin/ai-berkshire repository ships parallel entry points for both Claude Code (plain markdown files) and Codex skills, allowing you to invoke financial analysis tools directly from your terminal. Setting up the Claude Code integration requires three straightforward steps to register the markdown-based commands with the client.

Prerequisites

Before installing AI Berkshire, you must have the Claude Code client installed on your system. The client is distributed as an npm package that provides the claude binary.

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

This installation creates the claude command and establishes the default commands directory structure at $HOME/.claude/commands where AI Berkshire will store its skill files.

Step-by-Step Installation Guide

1. Clone the AI Berkshire Repository

Clone the canonical repository to access the markdown command files and installation utilities. The repository contains the command definitions under skills/ and helper scripts under scripts/.

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

2. Run the Installation Script

Execute the helper script scripts/install-claude-commands.sh to automatically configure the Claude Code commands. According to the source code, this script performs two critical operations: it creates the target directory at $HOME/.claude/commands (or your custom location) and copies every *.md file from skills/ into it.

./scripts/install-claude-commands.sh

The script also makes the utility scripts in tools/ executable, ensuring that skills requiring precise financial calculations can access Python utilities like financial_rigor.py.

3. Verify Installation

After installation, test the setup by invoking one of the available commands. The Claude Code client can now access any skill defined in the skills/ directory.

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

Customizing the Command Directory

If you prefer to store Claude Code commands in a non-standard location, set the CLAUDE_COMMANDS_DIR environment variable before running the installation script. This modifies the target path used by the install script on line 8.

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

The script will create the directory at your specified path and copy the markdown files there instead of the default location.

How the Installation Script Works

The scripts/install-claude-commands.sh file automates the manual setup process. According to the source implementation, the script:

  • Creates the target directory (default $HOME/.claude/commands) if it does not exist
  • Copies all *.md files from the skills/ directory into the target location
  • Makes utility scripts in tools/ executable to support skills requiring financial calculations

Because the commands are ordinary markdown files stored in the repository, updating AI Berkshire is as simple as pulling the latest changes and re-running the installation script.

Summary

  • Install the Claude Code client via npm (@anthropic-ai/claude-code) to obtain the claude binary
  • Clone the repository from xbtlin/ai-berkshire to access markdown skill files in skills/
  • Run scripts/install-claude-commands.sh to copy files to $HOME/.claude/commands and prepare tools/ utilities
  • Use environment variable CLAUDE_COMMANDS_DIR to customize the installation location
  • Invoke commands using the /command-name syntax, such as /investment-research or /news-pulse

Frequently Asked Questions

Where does AI Berkshire install the Claude Code commands?

By default, AI Berkshire installs Claude Code commands to $HOME/.claude/commands. The installation script scripts/install-claude-commands.sh creates this directory if it does not exist and copies all markdown files from the skills/ directory there. You can check this location to verify which commands are available or to manually remove them.

Can I install AI Berkshire to a custom directory?

Yes. Set the CLAUDE_COMMANDS_DIR environment variable to your preferred path before running the installation script. The script checks this variable when determining where to copy the skills/*.md files, allowing you to maintain commands in locations like $HOME/.my-claude-commands or shared directories.

What commands become available after installing AI Berkshire?

After installation, you gain access to investment analysis commands defined as markdown files in the skills/ directory. These include /investment-research for company analysis, /news-pulse for market sentiment tracking, and /portfolio-review for portfolio allocation analysis. Each command accepts relevant arguments, such as stock tickers or portfolio percentages.

Do I need to reinstall AI Berkshire after updating the repository?

Yes, you should re-run ./scripts/install-claude-commands.sh after pulling updates to the repository. Since the commands are version-controlled markdown files, updating the repository may add new skills or modify existing ones. Re-running the script ensures the latest versions are copied to your Claude Code commands directory and that any new utility scripts in tools/ are made executable.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →