# Pi Delegation (Execute & Read-Only Review)

> Offload multi-turn codebase scans, multi-file edits, test loops, and optional read-only Git reviews to your local pi CLI—via MCP or zero-config CLI fallback.

Pi Delegation (Execute & Read-Only Review) is a free AI agent skill on Agensi by jay, in Workflow Automation. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [jay](https://www.agensi.io/creators/jay-3)
- Category: [Workflow Automation](https://www.agensi.io/skills/workflow-automation)
- Version: 1.1
- Last updated: 2026-11-28
- Security: scan passed (2026-11-28); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/pi-delegation-execute-read-only-review
- Tags: ai-agents, automation, code-review, pi-cli, mcp-server, code-refactoring, coding, workflow

## About this skill

Keep your main AI coding agent focused on planning, architecture, and final judgment while offloading heavy, multi-turn repo work to faster or cheaper models through your local **`pi` CLI**.

Backed by the MIT-licensed open-source npm package `pi-for-antigravity`.

### What it does
- **Milestone-scoped `execute` (with optional `read_only` / `--read-only` mode)**: delegates broad codebase search, multi-file edits/refactors, test/debug loops, and log analysis to an isolated local `pi` process (`--no-extensions --no-mcp --no-skills`), with `session_id` resume support across milestones—or pass `read_only: true` (`--read-only`) for pure codebase exploration without file edits or shell access.
- **Optional read-only `review`**: launches a fresh, read-only `pi` reviewer (`read,grep,find,ls` only) on your working-tree Git diff against a baseline (default `HEAD`) plus untracked files (filtering out lockfile churn)—prioritizing regressions, invariants, and concrete bugs.
- **MCP-first with zero-config CLI fallback**: automatically prefers native `pi-for-antigravity` MCP tools if installed, and falls back seamlessly to `npx -y pi-for-antigravity execute|review` via shell when MCP is not configured.
- **Structured & transparent**: outputs clean JSON on `stdout` (`status`, `session_id`, `result`, `output_path`, and compact per-run `stats` including `elapsed_ms`, `turns`, `tool_calls`, `context_tokens`, `session_turns`, and optional `usage` to guide session reuse) and live progress on `stderr`, and auto-initializes a standalone config on first run using your local `pi` default model.

### Requirements
- **Node.js >= 22.19**
- A working, authenticated local **`pi`** CLI (`pi --version`)
- **Git** (for diff-based read-only reviews)

## Requires

- local pi CLI (authenticated)
- Git
- Node.js 22.19+
- Optional: pi-for-antigravity MCP server

npx -y pi-for-antigravity runs locally and only talks to your own configured pi provider.

## Known limitations

Requires Node.js 22.19+ and authenticated local pi CLI. Reviews must be assessed manually by the user; no automatic fix/review loops.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Pi Delegation (Execute & Read-Only Review) skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### How does Pi Delegation improve the performance of my main coding agent?

Pi Delegation acts as a 'sub-agent' that handles tedious, multi-step tasks like repo-wide refactors and test-debug loops. This prevents your main agent from suffering from context bloat or hallucinations during long, complex coding sessions.

### Which AI agents and environments are compatible with this skill?

This skill is compatible with any MCP-capable client like Claude Code, Cursor, or Codex, and it also includes a robust CLI fallback for shell-based environments. It requires Node.js version 22.19 or higher and the local pi CLI to function correctly.

### What exactly is included in the Pi Delegation skill package?

Once purchased, you receive the MCP server integration files and access to the Pi-specific CLI commands. The package includes documentation on scoping milestones and interpreting the structured JSON reports returned by the worker.

### How does the 'session persistence' feature differ from simply prompting an agent to continue?

Unlike standard prompts, this skill uses unique session IDs to maintain state across long-running tasks. This allows the worker to pause and resume work on a specific milestone without losing the progress or context of previous file edits and command logs.

### How does the risk-based review process work for sensitive code changes?

The 'review' command performs a read-only Git analysis of high-stakes changes like security or state management. It provides a structured report for human or architect-level verification rather than automatically applying potentially risky fixes.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
