Getting Started: Your First Multi-Agent Run in 5 Minutes
This guide gets you from zero to a working multi-agent session in under 5 minutes. You'll install Bernstein, configure Claude Code as your agent, run a goal, and understand the output.
Step 1: Install Bernstein
Bernstein requires Python 3.12+. Install it with pip or uv:
pip install bernsteinOr if you use uv:
uv pip install bernsteinVerify the installation:
bernstein --version
# bernstein 1.7.3Step 2: Configure your agent
Bernstein needs at least one CLI coding agent installed. The fastest setup uses Claude Code, but 21 agents are supported including Codex, Gemini CLI, Aider, and more.
Make sure Claude Code is installed and your API key is set:
# Install Claude Code if you haven't
npm install -g @anthropic-ai/claude-code
# Set your API key
export ANTHROPIC_API_KEY=sk-ant-...Bernstein auto-detects installed agents. Verify it finds yours:
bernstein agents
# Available agents:
# claude (Claude Code) ✓Step 3: Run your first goal
Navigate to any git repository and run a goal:
cd your-project
bernstein run --goal "Add type hints to all functions in src/utils.py"Bernstein will:
- Decompose the goal into concrete tasks
- Assign each task a role, priority, and model
- Spawn agents in isolated git worktrees
- Monitor progress via heartbeats and output parsing
- Merge completed work back to your branch
Step 4: Read the TUI
The terminal UI shows live progress:
┌─ Bernstein v1.7.3 ─────────────────────────────────┐
│ Goal: Add type hints to all functions in src/utils │
│ Tasks: 3 total │ 1 running │ 1 done │ 1 pending │
│ Agents: 2 active │ Cost: $0.12 │
├─────────────────────────────────────────────────────┤
│ ✓ task-001 Analyze existing type usage 00:42 │
│ ► task-002 Add type hints to helpers 01:15 │
│ ○ task-003 Add type hints to validators pending │
└─────────────────────────────────────────────────────┘- ✓ = completed and merged
- ► = currently running
- ○ = pending (waiting for dependencies or an available agent)
Press q to stop gracefully (agents finish their current task) or Ctrl+C to force stop.
Step 5: Check the results
When all tasks complete, check what changed:
git log --oneline -5
# a1b2c3d Add type hints to validator functions
# d4e5f6g Add type hints to helper functions
# h7i8j9k Analyze existing type usage in src/utils.pyEach agent's work is a separate commit, merged through Bernstein's merge queue. If any task failed, its changes are rolled back and the failure is logged in .sdd/dead_letter.json.
What to try next
Run a YAML plan for structured, multi-stage projects:
bernstein run plans/my-project.yamlPlans let you define stages, dependencies, roles, and complexity per task. See the plan file docs for the full schema.
Use multiple agent types by installing additional adapters:
# Bernstein will route tasks to the best available agent
pip install codex-cli # or install any supported agent
bernstein agents # see all detected agentsMonitor costs across sessions:
bernstein cost
# Session total: $0.47
# By model: haiku=$0.03, sonnet=$0.28, opus=$0.16Check the API for programmatic access:
# Task server runs on port 8052 during sessions
curl http://127.0.0.1:8052/statusFurther reading
- How Bernstein routes tasks to the right model — save 50-60% with the bandit router
- Running agents on Cloudflare — scale beyond your laptop
- GitHub repository — source code, issues, and discussions
- PyPI package — release history and downloads