Utilizes git worktrees to provide automated workers with isolated branches and dedicated working directories, enabling parallel development and conflict-free commits.
Interfaces with the iTerm2 Python API to programmatically spawn, layout, and monitor terminal panes and windows for a visible and manageable team of AI sessions.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Claude Team MCP Serverspawn two workers to refactor the API and update the documentation in parallel"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Claude Team MCP Server
An MCP server that allows one Claude Code session to spawn and manage a team of other Claude Code (or Codex) sessions via terminal backends (tmux or iTerm2).
Introduction
claude-team is an MCP server and a set of slash commands for allowing Claude Code to orchestrate a "team" of other Claude Code sessions. It uses terminal backends (tmux or iTerm2) to spawn new terminal sessions and run Claude Code within them.
Why?
Parallelism: Many development tasks can be logically parallelized, but managing that parallelism is difficult for humans with limited attention spans. Claude, meanwhile, is very effective at it.
Context management: Offloading implementation to a worker gives the implementing agent a fresh context window (smarter), and keeps the manager's context free of implementation details.
Background work: Sometimes you want to have Claude Code go research something or answer a question without blocking the main thread of work.
Visibility:
claude-teamspawns real Claude Code sessions. You can watch them, interrupt and take control, or close them out.
But, why not just use Claude Code sub-agents, you ask? They're opaque -- they go off and do things and you, the user, cannot effectively monitor their work, interject, or continue a conversation with them. Using a full Claude Code session obviates this problem.
Terminal Backends
claude-team supports two terminal backends:
Backend | Platform | Status |
tmux | macOS, Linux | Primary. Auto-selected when running inside tmux. |
iTerm2 | macOS only | Fully supported. Requires Python API enabled. |
Backend selection order:
CLAUDE_TEAM_TERMINAL_BACKENDenvironment variable (tmuxoriterm)Config file setting (
terminal.backend)Auto-detect: if
TMUXenv var is set, use tmux; otherwise iTerm2
Git Worktrees: Isolated Branches per Worker
A key feature of claude-team is git worktree support. When spawning workers with use_worktree: true (the default), each worker gets:
Its own working directory - A git worktree at
{repo}/.worktrees/{name}/Its own branch - Automatically created from the current HEAD
Shared repository history - All worktrees share the same
.gitdatabase, so commits are immediately visible across workers
Worktree naming depends on how workers are spawned:
With a bead (issue tracker ID):
{repo}/.worktrees/{bead}-{annotation}/Without:
{repo}/.worktrees/{worker-name}-{uuid}-{annotation}/
The .worktrees directory is automatically added to .gitignore.
Codex Support
Workers can run either Claude Code or OpenAI Codex. Set agent_type: "codex" in the worker config (or set the default in the config file) to spawn Codex workers instead of Claude Code workers.
Features
Spawn Workers: Create Claude Code or Codex sessions with multi-pane layouts
Terminal Backends: tmux (cross-platform) and iTerm2 (macOS)
Git Worktrees: Isolate each worker in its own branch and working directory
Send Messages: Inject prompts into managed workers (single or broadcast)
Read Logs: Retrieve conversation history from worker JSONL files
Monitor Status: Check if workers are idle, processing, or waiting for input
Idle Detection: Wait for workers to complete using stop-hook markers
Event Polling: Track worker lifecycle events (started, completed, stuck)
Visual Identity: Each worker gets a unique tab color and themed name (Marx Brothers, Beatles, etc.)
Session Recovery: Discover and adopt orphaned sessions after MCP server restarts
HTTP Mode: Run as a persistent service with streamable-http transport
Config File: Centralized configuration at
~/.claude-team/config.json
Requirements
Python 3.11+
uvpackage managertmux backend: tmux installed (macOS or Linux)
iTerm2 backend: macOS with iTerm2 and Python API enabled (Preferences > General > Magic > Enable Python API)
Codex workers (optional): OpenAI Codex CLI installed
Installation
As Claude Code Plugin (recommended)
This automatically configures the MCP server - no manual setup needed.
From PyPI
From Source
Configuration for Claude Code
Add to your Claude Code MCP settings. You can configure this at:
Global:
~/.claude/settings.jsonProject:
.claude/settings.jsonin your project directory
Using PyPI package
Using local clone
Project-level with auto project path
For project-scoped .mcp.json files, use CLAUDE_TEAM_PROJECT_DIR so workers inherit the project path:
After adding the configuration, restart Claude Code for it to take effect.
Config File
claude-team reads configuration from ~/.claude-team/config.json. Manage it with the CLI:
Config Schema
Section | Key | Description |
| string | Override Claude CLI command (e.g. |
| string | Override Codex CLI command (e.g. |
|
| Default agent type for new workers |
| bool | Default |
| bool | Create git worktrees by default |
|
| Default layout mode for spawn_workers |
|
| Terminal backend override (null = auto-detect) |
| int | Max event log file size before rotation |
| int | Hours of events to retain |
|
| Force a specific issue tracker |
Environment Variables
Variable | Default | Description |
| (auto-detect) | Force terminal backend: |
| (none) | Enables |
|
| Override the CLI command for Claude Code workers. |
|
| Override the CLI command for Codex workers. |
MCP Tools
Worker Management
Tool | Description |
| Create workers with multi-pane layouts. Supports Claude Code and Codex agents. |
| List all managed workers with status. Filter by status or project. |
| Get detailed worker status including conversation stats and last response preview. |
| Gracefully terminate one or more workers. Worktree branches are preserved. |
| Find existing Claude Code/Codex sessions running in tmux or iTerm2. |
| Import a discovered session into the managed registry. |
Communication
Tool | Description |
| Send a message to one or more workers. Supports wait modes: |
| Get paginated conversation history from a worker's JSONL file. |
| Add a coordinator note to a worker (visible in |
Monitoring
Tool | Description |
| Quick non-blocking check if workers are idle. |
| Block until workers are idle. Modes: |
| Read worker event log for started/completed/stuck workers since a timestamp. |
Utilities
Tool | Description |
| List git worktrees created by claude-team for a repository. Supports orphan cleanup. |
| Quick reference for the detected issue tracker (Beads or Pebbles). |
Worker Identification
Workers can be referenced by any of three identifiers:
Internal ID: Short hex string (e.g.,
3962c5c4)Terminal ID: Prefixed terminal session ID (e.g.,
iterm:UUIDortmux:%1)Worker name: Human-friendly name (e.g.,
Groucho,Aragorn)
All tools accept any of these formats.
Tool Details
spawn_workers
Worker assignment is determined by bead and/or prompt:
bead only: Worker follows issue tracker workflow (mark in_progress, implement, close, commit)
bead + prompt: Issue tracker workflow plus additional custom instructions
prompt only: Custom task with no issue tracking
neither: Worker spawns idle, waiting for a message
message_workers
wait_idle_workers
poll_worker_changes
HTTP Server Mode
Run claude-team as a persistent HTTP service instead of stdio:
HTTP mode enables:
Streamable HTTP transport for MCP communication
Worker poller that periodically snapshots worker state and emits lifecycle events
MCP Resources for read-only session access:
sessions://list- List all managed sessionssessions://{session_id}/status- Detailed session statussessions://{session_id}/screen- Terminal screen content
Slash Commands
Install slash commands for common workflows:
Command | Description |
| Analyze tasks, create worktrees, and spawn workers with appropriate prompts |
| Generate a status report for all active workers |
| Directly merge a worker's branch back to parent (for internal changes) |
| Create a pull request from a worker's branch |
| Generate end-of-session summary of all worker activity |
| Remove worktrees for merged branches |
Issue Tracker Support
claude-team supports both Pebbles (pb) and Beads (bd --no-db).
The tracker is auto-detected by marker directories in the project root:
.pebbles-> Pebbles.beads-> Beads
If both markers exist, Pebbles is selected by default. This can be overridden in the config file with issue_tracker.override. Worker prompts and coordination guidance use the detected tracker commands.
Usage Patterns
Basic: Spawn and Message
From your Claude Code session, spawn workers and send them tasks:
Parallel Work with Worktrees
Spawn workers in isolated branches for parallel development:
Issue Tracker Integration
Assign workers to issue tracker items for structured workflows:
Coordinated Workflow
Use the manager to coordinate between workers:
Architecture
The manager maintains:
Session Registry: Maps worker IDs/names to terminal sessions
Terminal Backend: Persistent connection to tmux or iTerm2 for terminal control
JSONL Monitoring: Reads Claude/Codex session files for conversation state and idle detection
Worktree Tracking: Manages git worktrees for isolated worker branches
Event Log: Records worker lifecycle events for polling and diagnostics
Development
Troubleshooting
tmux backend
"tmux not found"
Install tmux:
brew install tmux(macOS) orapt install tmux(Linux)Ensure tmux is in your PATH
Workers not detected after restart
Use
discover_workersto find orphaned sessionsUse
adopt_workerto re-register themSessions are matched via markers written to JSONL files
iTerm2 backend
"Could not connect to iTerm2"
Make sure iTerm2 is running
Enable: iTerm2 > Preferences > General > Magic > Enable Python API
General
"Session not found"
The worker may have been closed externally
Use
list_workersto see active workersWorkers can be referenced by ID, terminal ID, or name
"No JSONL session file found"
Claude Code may still be starting up
Wait a few seconds and try again
Check that Claude Code is actually running in the worker pane
Worktree issues
Use
list_worktreesto see worktrees for a repositoryOrphaned worktrees can be cleaned up with
list_worktrees+remove_orphans=trueWorktrees are stored at
{repo}/.worktrees/
Upgrading
After a new version is published to PyPI, you may need to force-refresh the cached version:
This is necessary because uvx aggressively caches tool environments.
License
MIT