How to Configure AI-Berkshire for Claude Integration: A Complete Setup Guide
To configure AI-Berkshire for Claude integration, install the Claude Code npm package, clone the repository, and execute ./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.
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.
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.
Deploy Skill Definitions
Execute the installation script to copy all skill files into Claude's commands directory.
./scripts/install-claude-commands.sh
This script performs three critical operations:
- Sets the destination path using
DEST="${CLAUDE_COMMANDS_DIR:-$HOME/.claude/commands}"(defaulting to~/.claude/commands) - Copies skill files via
cp "$ROOT"/skills/*.md "$DEST"/—this transfers all 18 research skills includinginvestment-research.mdandnews-pulse.md - Makes tools executable using
chmod +x "$ROOT"/tools/*.py "$ROOT"/tools/*.sh, ensuring helper scripts likefinancial_rigor.pycan 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.
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 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) 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) 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:
/investment-research 腾讯
This triggers the following execution chain:
- Claude loads
skills/investment-research.mdand parses the command structure - Four parallel agents initialize, each invoking
tools/financial_rigor.pyto fetch financial data - Each agent applies its specific investment philosophy (value investing, margin of safety, etc.)
- 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.
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 |
Bash installer that handles the CLAUDE_COMMANDS_DIR logic and file copying operations |
CLAUDE.md |
User guide containing installation instructions and the --dangerously-skip-permissions documentation |
skills/investment-research.md |
Primary skill definition for comprehensive equity research with four-agent orchestration |
tools/financial_rigor.py |
Core Python utility for decimal-precision calculations and data validation used across multiple skills |
skills/news-pulse.md |
Secondary skill for real-time news sentiment analysis |
Summary
- Install the client using
npm install -g @anthropic-ai/claude-codeto enable slash-command support - Run the installer
./scripts/install-claude-commands.shto copy all 18 skill files fromskills/to~/.claude/commands - Customize the path by setting
CLAUDE_COMMANDS_DIRbefore 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-permissionsonly 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 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. 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. The script will overwrite existing skill files in your Claude commands directory with the updated versions.
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 →