MCPcopy Index your code
hub / github.com/disler/pi-vs-claude-code

github.com/disler/pi-vs-claude-code @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
328 symbols 780 edges 20 files 3 documented · 1%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

pi-vs-cc

A collection of Pi Coding Agent customized instances. Why? To showcase what it looks like to hedge against the leader in the agentic coding market, Claude Code. Here we showcase how you can customize the UI, agent orchestration tools, safety auditing, agent to agent orchestration, and cross-agent integrations.

Want to see these 6+ unique Pi Agent Harnesses in action? Watch Pi Coding Agent: The Only Claude Code Competitor.

🆕 Pi-to-Pi agent-to-agent communication. Jump to Pi-to-Pi Communication or watch Pi to Pi: Two-Way Agent Orchestration.

pi-vs-cc


Prerequisites

All three are required:

Tool Purpose Install
Bun ≥ 1.3.2 Runtime & package manager bun.sh
just Task runner brew install just
pi Pi Coding Agent CLI Pi docs

API Keys

Pi does not auto-load .env files — API keys must be present in your shell's environment before you launch Pi. A sample file is provided:

cp .env.sample .env   # copy the template
# open .env and fill in your keys

.env.sample covers the four most popular providers:

Provider Variable Get your key
OpenAI OPENAI_API_KEY platform.openai.com
Anthropic ANTHROPIC_API_KEY console.anthropic.com
Google GEMINI_API_KEY aistudio.google.com
OpenRouter OPENROUTER_API_KEY openrouter.ai
Many Many Others *** Pi Providers docs

Sourcing your keys

Pick whichever approach fits your workflow:

Option A — Source manually each session:

source .env && pi

Option B — One-liner alias (add to ~/.zshrc or ~/.bashrc):

alias pi='source $(pwd)/.env && pi'

Option C — Use the just task runner (auto-wired via set dotenv-load):

just pi           # .env is loaded automatically for every just recipe
just ext-minimal  # works for all recipes, not just `pi`

Installation

bun install

Extensions

Extension File Description
pure-focus extensions/pure-focus.ts Removes the footer bar and status line entirely — pure distraction-free mode
minimal extensions/minimal.ts Compact footer showing model name and a 10-block context usage meter [###-------] 30%
cross-agent extensions/cross-agent.ts Scans .claude/, .gemini/, .codex/ dirs for commands, skills, and agents and registers them in Pi
purpose-gate extensions/purpose-gate.ts Prompts you to declare session intent on startup; shows a persistent purpose widget and blocks prompts until answered
tool-counter extensions/tool-counter.ts Rich two-line footer: model + context meter + token/cost stats on line 1, cwd/branch + per-tool call tally on line 2
tool-counter-widget extensions/tool-counter-widget.ts Live-updating above-editor widget showing per-tool call counts with background colors
subagent-widget extensions/subagent-widget.ts /sub <task> command that spawns background Pi subagents; each gets its own streaming live-progress widget
tilldone extensions/tilldone.ts Task discipline system — define tasks before starting work; tracks completion state across steps; shows persistent task list in footer with live progress
agent-team extensions/agent-team.ts Dispatcher-only orchestrator: the primary agent delegates all work to named specialist agents via dispatch_agent; shows a grid dashboard
system-select extensions/system-select.ts /system command to interactively switch between agent personas/system prompts from .pi/agents/, .claude/agents/, .gemini/agents/, .codex/agents/
damage-control extensions/damage-control.ts Real-time safety auditing — intercepts dangerous bash patterns and enforces path-based access controls from .pi/damage-control-rules.yaml
damage-control-continue extensions/damage-control-continue.ts Same rules as damage-control, but blocked tool calls return actionable feedback instead of aborting — the agent's turn keeps running and can adapt
agent-chain extensions/agent-chain.ts Sequential pipeline orchestrator — chains multiple agents where each step's output feeds into the next step's prompt; use /chain to select and run
pi-pi extensions/pi-pi.ts Meta-agent that builds Pi agents using parallel research experts for documentation
coms extensions/coms.ts Peer-to-peer messaging between Pi agents on the same machine over Unix sockets / named pipes. Tools: coms_list, coms_send, coms_get, coms_await
coms-net extensions/coms-net.ts Networked Pi-to-Pi via a shared HTTP/SSE hub (scripts/coms-net-server.ts). Works across machines on a LAN or behind a remote URL. Tools: coms_net_*
session-replay extensions/session-replay.ts Scrollable timeline overlay of session history - showcasing customizable dialog UI
theme-cycler extensions/theme-cycler.ts Keyboard shortcuts (Ctrl+X/Ctrl+Q) and /theme command to cycle/switch between custom themes

Usage

Run a single extension

pi -e extensions/<name>.ts

Stack multiple extensions

Extensions compose — pass multiple -e flags:

pi -e extensions/minimal.ts -e extensions/cross-agent.ts

Use just recipes

just wraps the most useful combinations. Run just with no arguments to list all available recipes:

just

Common recipes:

just pi                     # Plain Pi, no extensions
just ext-pure-focus         # Distraction-free mode
just ext-minimal            # Minimal context meter footer
just ext-cross-agent        # Cross-agent command loading + minimal footer
just ext-purpose-gate       # Purpose gate + minimal footer
just ext-tool-counter       # Rich two-line footer with tool tally
just ext-tool-counter-widget # Per-tool widget above the editor
just ext-subagent-widget    # Subagent spawner with live progress widgets
just ext-tilldone           # Task discipline system with live progress tracking
just ext-agent-team         # Multi-agent orchestration grid dashboard
just ext-system-select      # Agent persona switcher via /system command
just ext-damage-control     # Safety auditing + minimal footer
just ext-damage-control-continue # Same rules, but blocked turns keep running
just ext-agent-chain        # Sequential pipeline orchestrator with step chaining
just ext-pi-pi              # Meta-agent that builds Pi agents using parallel experts
just ext-session-replay     # Scrollable timeline overlay of session history
just ext-theme-cycler       # Theme cycler + minimal footer
just all                    # Open every extension in its own terminal window

# Pi-to-Pi communication (see section below)
just local-coms             # Same-machine peer-to-peer over Unix sockets
just coms-net-server        # Start a local coms-net HTTP/SSE hub (127.0.0.1)
just coms-net-server-lan    # Start a LAN-visible hub (requires PI_COMS_NET_AUTH_TOKEN)
just coms                   # Pi client for the coms-net hub
just coms1                  # …same, pinned to gpt-5.5
just coms2                  # …same, pinned to claude-opus-4-7

The open recipe allows you to spin up a new terminal window with any combination of stacked extensions (omit .ts):

just open purpose-gate minimal tool-counter-widget

Project Structure

pi-vs-cc/
├── extensions/          # Pi extension source files (.ts) — one file per extension
├── specs/               # Feature specifications for extensions
├── .pi/
│   ├── agent-sessions/  # Ephemeral session files (gitignored)
│   ├── agents/          # Agent definitions for team and chain extensions
│   │   ├── pi-pi/       # Expert agents for the pi-pi meta-agent
│   │   ├── agent-chain.yaml # Pipeline definition for agent-chain
│   │   ├── teams.yaml   # Team definition for agent-team
│   │   └── *.md         # Individual agent persona/system prompts
│   ├── skills/          # Custom skills
│   ├── themes/          # Custom themes (.json) used by theme-cycler
│   ├── damage-control-rules.yaml # Path/command rules for safety auditing
│   └── settings.json    # Pi workspace settings
├── justfile             # just task definitions
├── CLAUDE.md            # Conventions and tooling reference (for agents)
├── THEME.md             # Color token conventions for extension authors
└── TOOLS.md             # Built-in tool function signatures available in extensions

Orchestrating Multi-Agent Workflows

Pi's architecture makes it easy to coordinate multiple autonomous agents. This playground includes several powerful multi-agent extensions:

Subagent Widget (/sub)

The subagent-widget extension allows you to offload isolated tasks to background Pi agents while you continue working in the main terminal. Typing /sub <task> spawns a headless subagent that reports its streaming progress via a persistent, live-updating UI widget above your editor.

Agent Teams (/team)

The agent-team orchestrator operates as a dispatcher. Instead of answering prompts directly, the primary agent reviews your request, selects a specialist from a defined roster, and delegates the work via a dispatch_agent tool. - Teams are configured in .pi/agents/teams.yaml where each top-level key is a team name containing a list of agent names (e.g., frontend: [planner, builder, bowser]). - Individual agent personas (e.g., builder.md, reviewer.md) live in .pi/agents/. - pi-pi Meta-Agent: The pi-pi team specifically delegates tasks to specialized Pi framework experts (ext-expert.md, theme-expert.md, tui-expert.md) located in .pi/agents/pi-pi/ to build high-quality Pi extensions using parallel research. - Web Crawling Fallbacks: To ingest the latest framework documentation dynamically, these experts use firecrawl as their default modern page crawler, but are explicitly programmed to safely fall back to the native curl baked into their bash toolset if Firecrawl fails or is unavailable.

Agent Chains (/chain)

Unlike the dynamic dispatcher, agent-chain acts as a sequential pipeline orchestrator. Workflows are defined in .pi/agents/agent-chain.yaml where the output of one agent becomes the input ($INPUT) to the next. - Workflows are defined as a list of steps, where each step specifies an agent and a prompt. - The $INPUT variable injects the previous step's output (or the user's initial prompt for the first step), and $ORIGINAL always contains the user's initial prompt. - Example: The plan-build-review pipeline feeds your prompt to the planner, passes the plan to the builder, and finally sends the code to the reviewer.


Pi-to-Pi Agent-to-Agent Communication

Pi to Pi — Two-Way Agent Communication with the Pi Coding Agent

📺 Watch: Pi to Pi: Two-Way Agent Orchestration with the Pi Coding Agent

What's better than one Pi coding agent? Two. What's better than two isolated side-by-side agents? Two agents that actually talk to each other. Subagents, dispatch queues, and agent chains all share one shap

Extension points exported contracts — how you extend this code

Rule (Interface)
(no doc)
extensions/damage-control.ts
Rule (Interface)
(no doc)
extensions/damage-control-continue.ts
AgentCard (Interface)
(no doc)
extensions/coms-net.ts
ExpertDef (Interface)
(no doc)
extensions/pi-pi.ts
AgentDef (Interface)
(no doc)
extensions/system-select.ts
SubState (Interface)
(no doc)
extensions/subagent-widget.ts
AgentDef (Interface)
(no doc)
extensions/agent-team.ts
Envelope (Interface)
(no doc)
extensions/coms.ts

Core symbols most depended-on inside this repo

errorJson
called by 31
scripts/coms-net-server.ts
audit
called by 20
extensions/coms-net.ts
makeDetails
called by 19
extensions/tilldone.ts
applyExtensionDefaults
called by 18
extensions/themeMap.ts
safeError
called by 17
extensions/coms-net.ts
dim
called by 15
scripts/coms-net-server.ts
nowIso
called by 12
extensions/coms-net.ts
displayName
called by 12
extensions/pi-pi.ts

Shape

Function 270
Interface 43
Method 9
Class 6

Languages

TypeScript100%

Modules by API surface

scripts/coms-net-server.ts60 symbols
extensions/coms.ts59 symbols
extensions/coms-net.ts55 symbols
extensions/agent-chain.ts21 symbols
extensions/tilldone.ts19 symbols
extensions/agent-team.ts18 symbols
extensions/pi-pi.ts16 symbols
extensions/cross-agent.ts14 symbols
extensions/session-replay.ts10 symbols
extensions/subagent-widget.ts8 symbols
extensions/damage-control-continue.ts8 symbols
extensions/theme-cycler.ts7 symbols

For agents

$ claude mcp add pi-vs-claude-code \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact