The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the Claude Octopus listing page.
One brain, many arms.
An MCP server that wraps the Claude Agent SDK, letting you run multiple specialized Claude Code agents — each with its own model, tools, system prompt, and personality — from any MCP client.
Claude Code is powerful. But one instance does everything the same way. Sometimes you want a strict code reviewer that only reads files. A test writer that defaults to TDD. A cheap quick helper on Haiku. A deep thinker on Opus.
Claude Octopus lets you spin up as many of these as you need. Same binary, different configurations. Each one shows up as a separate tool in your MCP client.
claude CLI installationANTHROPIC_API_KEY env var) or an active Claude Code OAuth sessionThree paths, pick whichever matches your MCP client.
Skip the install entirely — reference claude-octopus@latest in your .mcp.json and the client will fetch on demand (see Quick Start below).
The server is published to the MCP Registry under the name io.github.xiaolai/claude-octopus. Registry-aware MCP clients can resolve and install it by that name without touching npm directly.
The fastest way to get started:
This interactive wizard lets you pick a template, detects your MCP client, and writes the config for you.
Or add to your .mcp.json manually:
This gives you six tools:
| Tool | Purpose |
|---|---|
claude_code | Send a task, get a result |
claude_code_reply | Continue a conversation |
claude_code_timeline | Query the workflow timeline |
claude_code_transcript | Read full session transcripts |
claude_code_sessions | List Claude Code session history (this project, or all) |
claude_code_report | Generate HTML reports |
That's it — you have Claude Code as a tool, with full workflow observability built in.
The real power is running several instances with different configurations:
Your MCP client now sees distinct tools for each agent — code_reviewer, test_writer, quick_qa — each purpose-built.
Agents can coordinate through a coordinator pattern: one agent has the others as inner MCP tools via CLAUDE_MCP_SERVERS, and its system prompt drives the pipeline.
The coordinator agent autonomously calls researcher, architect, etc. as MCP tools — fully autonomous, no human in the loop until it finishes. Every invocation is tracked in the shared timeline.
Don't want to write configs by hand? Add a factory instance:
This exposes a single create_claude_code_mcp tool — an interactive wizard. Tell it what you want ("a strict code reviewer that only reads files") and it generates the .mcp.json entry for you, listing all available options you can customize.
In factory-only mode, no query tools are registered — just the wizard. This keeps routing clean: the factory creates agents, the agents do work.
Don't want to edit JSON by hand? The init wizard gets you from zero to working in 30 seconds:
It auto-detects installed MCP clients (Claude Desktop, Claude Code, Cursor, Windsurf), merges with existing config, and warns before overwriting.
Five built-in templates, battle-tested and ready to use:
| Template | Agents | Purpose |
|---|---|---|
code-review-team | code-reviewer (opus), test-writer (sonnet), security-auditor (opus) | Thorough code review pipeline |
publishing-house | researcher (sonnet), architect (opus), editor (sonnet), proofreader (haiku) | Multi-stage content/code pipeline |
tiered-models | quick-qa (haiku), coder (sonnet), deep-thinker (opus) | Right model for the job |
solo-agent | claude (default) | Single agent, quick setup |
factory | agent-factory | Generates configs on demand |
Each agent comes pre-tuned with appropriate model, tools, effort level, and system prompt.
Monitor your agents in real time:
Opens a local web dashboard at http://localhost:3456 with:
The dashboard reads the same timeline index used by the _timeline and _report tools. No additional configuration needed.
Each non-factory instance exposes:
| Tool | Purpose |
|---|---|
<name> | Send a task to the agent, get a response + session_id + run_id |
<name>_reply | Continue a previous conversation by session_id |
<name>_timeline | Query the cross-agent workflow timeline |
<name>_transcript | Retrieve full session transcript from Claude Code's storage |
<name>_sessions | List Claude Code session history — this project by default, or all projects with all_projects: true |
<name>_report | Generate a self-contained HTML report for a run or all runs |
| Parameter | Description |
|---|---|
prompt | The task or question (required) |
run_id | Workflow run ID — groups related agent calls into one timeline. Auto-generated if omitted; returned in every response for propagation. |
cwd | Working directory override |
model | Model override (sonnet, opus, haiku, or full ID) |
tools | Restrict available tools (intersects with server restriction) |
disallowedTools | Block additional tools (unions with server blacklist) |
additionalDirs | Extra directories the agent can access |
plugins | Additional plugin paths to load |
effort | Thinking effort (low, medium, high, max) |
permissionMode | Permission mode (can only tighten, never loosen) |
maxTurns | Max agent-loop round trips (see effort counters) |
maxBudgetUsd | Max spend in USD |
systemPrompt | Additional prompt (appended to server default) |
Every agent invocation is recorded in a lightweight JSONL index at ~/.claude-octopus/timelines/timeline.jsonl. This solves the multi-agent correlation problem: when several agents participate in a workflow, the timeline tracks which sessions belong to the same run, in what order they executed, and what role each played.
Full session transcripts stay in Claude Code's own storage (~/.claude/projects/). The timeline is just the table of contents — ~200 bytes per entry — that cross-references via session_id.
<name> and <name>_reply call appends one line to the timelinerun_id, all agents sharing the same run_id are grouped into one runrun_id, one is auto-generated and returned in the response — pass it to subsequent agents to keep them groupedGenerate self-contained HTML reports with agent sequence visualization, cost breakdown, and collapsible transcripts. Dark theme, no external dependencies — one file, open in any browser.
Three numbers describe how much work an invocation took. They are not interchangeable, and the first one is the one that surprises people:
| Metric | What it counts |
|---|---|
num_turns (shown as SDK turns) | Raw value from the Agent SDK. Measured against the runtime it tracks tool_use blocks plus the final response — not API round trips. |
response_groups (responses) | Distinct assistant responses in the main agent loop — one per API round trip, no matter how many tools that response called in parallel. |
tool_calls (tool calls) | tool_use blocks issued across the main agent loop. |
When an agent calls several tools in parallel, num_turns climbs faster than
the number of visible responses. A run with 3 assistant responses issuing 4
tool calls reports num_turns: 5, response_groups: 3, tool_calls: 4.
maxTurns, meanwhile, is enforced against round trips: that same run
completes under maxTurns: 3 and aborts under maxTurns: 2. So size
maxTurns against responses, not against SDK turns.
Both new counters cover the main agent loop only — work inside a sub-agent
(Task) belongs to its own loop and is excluded. Timeline entries written by
older versions have neither, and render as — rather than as a false zero.
All configuration is via environment variables in .mcp.json. Every env var is optional.
| Env Var | Description | Default |
|---|---|---|
CLAUDE_TOOL_NAME | Tool name prefix (generates <name>, <name>_reply, <name>_timeline, <name>_transcript, <name>_report) | claude_code |
CLAUDE_DESCRIPTION | Tool description shown to the host AI | generic |
CLAUDE_SERVER_NAME | MCP server name in protocol handshake | claude-octopus |
CLAUDE_FACTORY_ONLY | Only expose the factory wizard tool | false |
| Env Var | Description | Default |
|---|---|---|
CLAUDE_MODEL | Model (sonnet, opus, haiku, or full ID) | SDK default |
CLAUDE_CWD | Working directory | process.cwd() |
CLAUDE_PERMISSION_MODE | default, acceptEdits, bypassPermissions, plan | default |
CLAUDE_ALLOWED_TOOLS | Comma-separated tool restriction (available tools) | all |
CLAUDE_DISALLOWED_TOOLS | Comma-separated tool blacklist | none |
CLAUDE_MAX_TURNS | Max agent-loop round trips per invocation | unlimited |
CLAUDE_MAX_BUDGET_USD | Max spend per invocation | unlimited |
CLAUDE_EFFORT | low, medium, high, max | SDK default |
| Env Var | Description |
|---|---|
CLAUDE_SYSTEM_PROMPT | Replaces the default Claude Code system prompt |
CLAUDE_APPEND_PROMPT | Appended to the default prompt (usually what you want) |
| Env Var | Description |
|---|---|
CLAUDE_ADDITIONAL_DIRS | Extra directories to grant access (comma-separated) |
CLAUDE_PLUGINS | Local plugin paths (comma-separated) |
CLAUDE_MCP_SERVERS | MCP servers for the inner agent (JSON) |
CLAUDE_PERSIST_SESSION | true/false — enable session resume (default: true) |
CLAUDE_SETTING_SOURCES | Settings to load: user, project, local |
CLAUDE_SETTINGS | Path to settings JSON or inline JSON |
CLAUDE_BETAS | Beta features (comma-separated) |
| Env Var | Description | Default |
|---|---|---|
CLAUDE_TIMELINE_DIR | Directory for the cross-agent timeline index | ~/.claude-octopus/timelines |
| Env Var | Description | Default |
|---|---|---|
ANTHROPIC_API_KEY | Anthropic API key for this agent | inherited from parent |
CLAUDE_CODE_OAUTH_TOKEN | Claude Code OAuth token for this agent | inherited from parent |
Leave both unset to inherit auth from the parent process. Set one per agent to use a different account or billing source.
Lists accept JSON arrays when values contain commas: ["path,with,comma", "/normal"]
default — tool executions prompt for approval unless you explicitly set bypassPermissions.cwd overrides preserve agent knowledge — when the host overrides cwd, the agent's configured base directory is automatically added to additionalDirectories so it retains access to its own context.tools intersects with the server restriction (can only remove tools, not add). disallowedTools unions (can only block more)._reply and _transcript tools respect persistence — not registered when CLAUDE_PERSIST_SESSION=false.| Feature | Built-in claude | claude-code-mcp | Claude Octopus |
|---|---|---|---|
| Approach | Built-in | CLI wrapping | Agent SDK |
| Tools per instance | 16 raw tools | 1 prompt tool | 5 (prompt, reply, timeline, transcript, report) |
| Multi-instance | No | No | Yes |
| Per-instance config | No | No | Yes (20 env vars) |
| Init wizard | No | No | Yes (init + 5 templates) |
| Factory wizard | No | No | Yes |
| Session continuity | No | No | Yes |
| Cross-agent timeline | No | No | Yes |
| Web dashboard | No | No | Yes (live, SSE) |
| HTML reports | No | No | Yes |
ISC - Xiaolai Li