Help us improve
Share bugs, ideas, or general feedback.
Share bugs, ideas, or general feedback.
Share bugs, ideas, or general feedback.
Orchestrate Pi agents from Claude Code for cost-effective task delegation
npx claudepluginhub crichalchemist/agent-pi --plugin claude-piUse when a task is mechanical, parallelizable, requires a different model's strengths, or where delegating preserves tokens — file generation, boilerplate, batch transforms, research, summarization, or any subtask independent of the current conversation context.
Use when running a superpowers workflow — subagent-driven-development, dispatching-parallel-agents, systematic-debugging, or requesting-code-review — to decide which roles should go to Pi versus the Agent tool
A Claude Code plugin that turns Pi into a multi-agent orchestration layer. Run diverse agentic workflows by coordinating a fleet of AI models — Gemini, GPT-4, Claude Haiku, and others — in parallel, outside your context window.
Claude orchestrates. Pi executes.
When Claude identifies a subtask that is independent, parallelizable, or better suited to a different model, it can delegate that work to a Pi agent and continue reasoning in the main session. Agents run concurrently across providers, each chosen for what it's best at — not just what's cheapest.
At every session start, the plugin discovers your available Pi models and reports them before any user interaction. Claude uses those models throughout the session without any manual configuration.
If you have the superpowers plugin installed, the plugin detects it and surfaces a dedicated skill for routing superpowers workflow roles — spec reviewers, code quality reviewers, parallel investigation agents — to the appropriate Pi model.
Configure Pi auth once before installing the plugin:
pi auth
Or set provider environment variables directly:
export ANTHROPIC_API_KEY=sk-ant-...
export GEMINI_API_KEY=AIza...
export OPENAI_API_KEY=sk-...
claude /plugin install github:crichalchemist/agent-pi
No build step required — compiled files are included in the repository.
The plugin patches ~/.claude/CLAUDE.md to instruct Claude to lead with Pi for multi-agent workflows, and writes .mcp.json in the current project directory to register the MCP server.
When a Claude Code session opens, the plugin runs a one-shot script that queries Pi for available models and delivers a notification before any user interaction:
[pi-models] Available: gemini-2.5-pro (frontier), gemini-2.0-flash (fast), gpt-4o (balanced) — default: google/gemini-2.5-pro — use pi_list_models to refresh
Claude reads this notification and routes tasks to the appropriate tier.
| Tier | Examples | Best for |
|---|---|---|
| fast | gemini-2.0-flash, claude-haiku-4-5, gpt-4o-mini | Formatting, boilerplate, retrieval, mechanical transforms |
| balanced | gpt-4o, claude-sonnet-4-6, o3-mini | Standard coding, analysis, review, research |
| frontier | gemini-2.5-pro, claude-opus-4-7, o3 | Novel reasoning, architecture, security review, state-of-the-art tasks |
The plugin registers seven tools on the pi MCP server:
| Tool | Description |
|---|---|
pi_list_models | Refresh available models mid-session |
pi_run_task | Run a task and wait for the result (blocking) |
pi_spawn_agent | Spawn an agent and return a session ID immediately |
pi_steer_agent | Send a mid-task steering message (delivered after current turn finishes) |
pi_followup_agent | Queue a non-interruptive message (delivered only after agent finishes all work) |
pi_poll_agent | Check status and partial output of a spawned agent |
pi_get_result | Wait for a spawned agent to finish and return output |
pi_terminate_agent | Abort a running agent |
The primary pattern for multi-agent work:
pi_spawn_agent × N → pi_poll_agent loop → pi_get_result × N → synthesize
Spawn N agents with independent, self-contained prompts. Poll for progress and steer if needed. Collect results and synthesize in the main session.
The plugin ships two skills:
skills/orchestrate/SKILL.md — guides Claude on when to delegate, which model tier to choose, and how to use the parallel-spawn pattern. Invoke with /claude-pi:orchestrate.
skills/superpowers/SKILL.md — routes superpowers workflow roles to Pi. Spec compliance reviewers, code quality reviewers, and parallel investigation agents are read-only and context-independent — ideal for Pi. Implementer subagents that need Edit/Bash stay on the Agent tool. Invoke with /claude-pi:superpowers.
The plugin adds a live status line to Claude Code showing running and recently completed Pi agents:
● 2 running ✓ 3 done
npm install
npm test # 80 unit tests
npm run build # compile src/ → bin/
Tests use vitest. The Pi SDK is never imported in tests — all external dependencies are injectable.
MIT
Share bugs, ideas, or general feedback.
Based on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
Edit and iterate on documents with any MCP-capable AI. Claude is the default and best-supported client today.
Analyze YouTube channel catalogs: pull transcripts, extract structured features with Claude, synthesize a content constitution.
Drive Adobe Premiere Pro 2025, Illustrator 2026, and Acrobat DC from scripts and AI agents without touching a mouse.
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge.
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge.
Sign in to claim