How to Install Claude Code Commands for AI Berkshire: A Complete Guide
Run npm install -g @anthropic-ai/claude-code, clone the xbtlin/ai-berkshire repository, and execute ./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.
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.
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 to create the target directory and copy the markdown skill files.
./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:
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:
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, 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 to sync your local commands with the latest versions.
Summary
- Install the client: Run
npm install -g @anthropic-ai/claude-codeto get theclaudebinary. - Deploy commands: Execute
./scripts/install-claude-commands.shfrom the cloned repository to copyskills/*.mdinto$HOME/.claude/commands. - Customize paths: Set
CLAUDE_COMMANDS_DIRbefore 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 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 script makes the utility scripts in tools/ executable. These Python utilities, such as 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 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.
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:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →