Agent skill

Pi Delegator

by luongnv89 in luongnv89/pi-extensions

Delegate approved coding tasks to Pi subprocesses with free opencode defaults, model setup, live progress, and metrics.

MITAuto-check passed

Install Pi Delegator

skills CLI
$ npx skills add luongnv89/pi-extensions --skill pi-delegator -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install luongnv89/pi-extensions pi-delegator --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/luongnv89/pi-extensions.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/pi-delegator .claude/skills/pi-delegator && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
pi-delegator
GitHub stars
140
Token cost
~1.6k tokens
SKILL.md length
650 words
Files
6 (incl. scripts, references)
Skills in repo
1
Repo updated
First seen
Licence
MIT

At a glance

Delegate approved coding tasks to Pi subprocesses with free opencode defaults, model setup, live progress, and metrics.

  • Works in 6 steps: Check models and configure default → Capture clear input → Select model and thinking → …
  • SKILL.md covers Repo Sync Before Edits…, Safety contract, Prerequisites and Step 1 — Check models and…, plus 7 more sections
  • Runs Python scripts from its folder; calls git and python3

What it does

Pi Delegator is an agent skill from luongnv89/pi-extensions. Delegate approved coding tasks to Pi subprocesses with free opencode defaults, model setup, live progress, and metrics. Don't use for direct edits, CI, or non-Pi agents.

Its SKILL.md is about 1.6k tokens, which your agent loads only when the skill is triggered. The skill folder holds 9 other files, including scripts and reference files (for example `docs/README.md`, `evals/evals.json` and `references/event-monitoring.md`).

The repository describes itself as: Collection of extensions and themes for Pi Coding Agent. The licence is MIT.

Example prompts

  • “/pi-delegator”

Requirements

  • Python 3

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Check models and configure default
  2. Capture clear input
  3. Select model and thinking
  4. Approval gate
  5. Run and monitor Pi
  6. Report result and metrics

What it can do on your machine

Read from SKILL.md and the folder at commit dea3eaa. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • git
    • python3

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Pi Delegator loads about 1.6k tokens when it runs, and up to ~2.6k if it reads all its reference files. Until then it costs about 46 tokens; SKILL.md has 650 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~46
When it runs · the whole SKILL.md, loaded when a task matches
~1.6k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~2.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from luongnv89/pi-extensions at commit dea3eaa, republished under its MIT licence (© luongnv89). 650 words, ~1,563 tokens.

Download SKILL.mdSave it as .claude/skills/pi-delegator/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
pi-delegator
description
Delegate approved coding tasks to Pi subprocesses with free opencode defaults, model setup, live progress, and metrics. Don't use for direct edits, CI, or non-Pi agents.
license
MIT
effort
high
metadata.version
1.0.0
metadata.author
Luong NGUYEN <luongnv89@gmail.com>

Pi Delegator

Use this skill when another AI agent should delegate a clearly scoped task to a separate Pi instance, monitor Pi while it works, and report exact session metrics. The main agent stays the orchestrator: it captures intent, gets user approval, selects a model, runs Pi, and summarizes the result.

Repo Sync Before Edits (mandatory)

If the delegated Pi task may modify a git repository, sync the target repo before starting Pi so the delegated work begins from current code:

bash
branch="$(git rev-parse --abbrev-ref HEAD)"
git fetch origin
git pull --rebase origin "$branch"

If the working tree is dirty, stash first, sync, then pop. If origin is missing or conflicts occur, stop and ask the user before continuing.

Safety contract

  • Never start Pi until the user approves the exact run preview.
  • Prefer free opencode-cli models whenever that provider is available.
  • Do not hide that a non-free model will be used; ask for explicit approval.
  • Do not invent token, cost, or duration metrics. Report only collected values.
  • Keep Pi's task prompt clear and bounded; Pi should know what to do, where to work, what tools are allowed, and what output is expected.

Prerequisites

Before any delegation, verify:

bash
which pi
python3 --version

If either command fails, stop and tell the user what to install. Resolve the bundled helper relative to this skill directory, then use it for model discovery, config persistence, execution, event monitoring, and metrics collection:

bash
helper="<absolute-path-to-this-skill>/scripts/pi_delegate.py"

Step 1 — Check models and configure default

Run model discovery first on every skill invocation:

bash
python3 "$helper" models --prefer-free

The helper reads Pi's available models and highlights free opencode-cli models. Configuration is stored in:

text
~/.pi/agent/skills/pi-delegator/config.json

If no config exists, or the configured model is no longer available:

  1. Show the model list or the helper's recommended free default.
  2. Ask the user to select a default model and thinking level.
  3. Save it with:
bash
python3 "$helper" configure \
  --model "provider/model" \
  --thinking "low"

Default policy: if opencode-cli is available, recommend and use an opencode-cli model unless the user explicitly chooses another provider.

Step 2 — Capture clear input

Build a delegation brief before asking for approval:

  • Task: the exact work Pi should perform.
  • Target cwd: absolute path where Pi will run.
  • Permissions: read-only, edit files, run tests, install deps, or other limits.
  • Tools: allowed Pi tools, such as read,bash,edit,write or read-only tools.
  • Constraints: files to avoid, coding standards, time limits, expected tests.
  • Expected output: summary only, changed files, patch, report path, etc.
  • Complexity: simple, medium, or complex.

If any field is unclear, ask a concise clarifying question before continuing.

Show full SKILL.md (257 more words)Show less

Step 3 — Select model and thinking

Read references/model-selection.md when choosing a model. In short:

  • Simple tasks: free opencode-cli if available, thinking off or minimal.
  • Medium tasks: free capable model if available, thinking low or medium.
  • Complex/risky tasks: strongest available free model first; if a paid model is recommended, ask the user to approve the paid model explicitly.

Respect user overrides. If the run will use a non-free provider while opencode-cli is available, include that warning in the approval preview.

Step 4 — Approval gate

Show this preview and wait for explicit approval:

text
◆ Pi Delegation Preview
┄┄┄┄┄┄┄┄┄┄┄┄┄
  Task:       <one sentence>
  Cwd:        <absolute path>
  Model:      <provider/model>
  Thinking:   <off|minimal|low|medium|high|xhigh>
  Tools:      <tool allowlist>
  Permissions:<read-only|can edit|can run tests|...>
  Complexity: <simple|medium|complex>

Run Pi with this task? [y/N]

Default to No. If the user declines, stop without launching Pi.

Step 5 — Run and monitor Pi

After approval, write the delegation prompt to a temporary file and run:

bash
python3 "$helper" run \
  --approved \
  --task-file /tmp/pi-task.md \
  --cwd "<target-cwd>" \
  --model "<provider/model>" \
  --thinking "<level>" \
  --tools "read,bash,edit,write" \
  --approve-project \
  --session-name "pi-delegated-task"

The helper uses Pi RPC mode, streams progress events, and requests final session stats. Read references/event-monitoring.md for the event-to-progress mapping. Use --verbose only when the user asks for raw streaming detail.

Step 6 — Report result and metrics

Return a compact report:

text
◆ Pi Delegation Complete
┄┄┄┄┄┄┄┄┄┄┄┄┄
  Result:       DONE | FAILED | ABORTED
  Duration:     <seconds>
  Model:        <provider/model>
  Thinking:     <level>
  Tokens:       input <n>, output <n>, cache read <n>, cache write <n>
  Cost:         <amount or not reported>
  Tool calls:   <n>
  Session:      <session file or not persisted>

  Summary:
  <Pi's final answer or concise synthesis>

If Pi changed files, list them from git status --short after the run. Do not claim tests passed unless Pi or the main agent actually ran them.

Error handling

  • Missing pi: ask the user to install Pi and stop.
  • No models available: ask the user to authenticate Pi or configure providers.
  • Configured model unavailable: rerun model selection and update config.
  • User declines approval: stop cleanly.
  • Pi process fails: show stderr, partial progress, and any collected metrics.
  • Metrics unavailable: write not reported instead of guessing.

Step Completion Reports

After each major phase, print a compact status block:

text
◆ <Phase> ([step N of 6])
┄┄┄┄┄┄┄┄┄┄┄
  Models checked:    ✓ pass
  Free default:      ✓ pass (opencode-cli available)
  User approval:     ✓ approved
  Result:            PASS

© luongnv89, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 5 other files (scripts, references) in skills/pi-delegator of luongnv89/pi-extensions.

  • SKILL.md
  • docs/README.md
  • evals/evals.json
  • references/event-monitoring.md
  • references/model-selection.md
  • scripts/pi_delegate.py

Open the folder on GitHubat commit dea3eaa

Compare with similar skills

Pi Delegator next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Pi Delegator compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Pi Delegator this skillluongnv89/pi-extensions140—~1.6kAutomated safety check: PassMIT
Delegate Setupsickn33/agentic-awesome-skills47k1 repos~2.8kAutomated safety check: PassMIT
Delegate Workpaperclipai/paperclip99k—~372Automated safety check: PassMIT
Operator Approval Loopaffaan-m/ECC276k—~3.3kAutomated safety check: PassMIT
Event Delegationthedaviddias/Front-End-Checklist74k—~500Automated safety check: PassMIT
Delegating To Agentssickn33/agentic-awesome-skills47k1 repos~1kAutomated safety check: PassMIT

Similar skills

  • Delegate Setup

    sickn33/agentic-awesome-skills

    Configure approved delegation lanes across installed implementer CLIs, including optional model and effort choices, then write global or project config only after explicit user approval.

    47k GitHub starsUsed in 1 repo~2.8k tokens
    Agent WorkflowsAuto-check passed
  • Delegate Work

    paperclipai/paperclip

    Delegate user-requested work to an existing Paperclip agent, with a durable task reference and clear execution expectations.

    99k GitHub stars~372 tokensUpdated today
    Auto-check passed
  • Operator approval contract with internal filing notices for agent-drafted outbound messages, hashed drafts, epoch-keyed decisions, durable delivery claims and receipts, and a pre-draft baseline gate.

    276k GitHub stars~3.3k tokensUpdated today
    Auto-check passed
  • Event Delegation

    thedaviddias/Front-End-Checklist

    A skill your agent uses when reviewing scripts, client components, bundles, or runtime behavior related to Use event delegation for dynamic content.

    74k GitHub stars~500 tokensUpdated 4 days ago
    Auto-check passed
  • Delegating To Agents

    sickn33/agentic-awesome-skills

    Delegate bounded work to other AI agents while preserving context, ownership, and progress checks.

    47k GitHub starsUsed in 1 repo~1k tokens
    Auto-check passed
  • Opencode Delegate

    sickn33/agentic-awesome-skills

    Delegate coding tasks to the OpenCode CLI only when the user explicitly requests it, while the orchestrator retains review and landing responsibility.

    47k GitHub starsUsed in 1 repo~2.8k tokens
    Auto-check passed

Questions about Pi Delegator

What does Pi Delegator do?

Delegate approved coding tasks to Pi subprocesses with free opencode defaults, model setup, live progress, and metrics. Pi Delegator is an agent skill from luongnv89/pi-extensions. Delegate approved coding tasks to Pi subprocesses with free opencode defaults, model setup, live progress, and metrics.

How do I install Pi Delegator in Claude Code?

Run `npx skills add luongnv89/pi-extensions --skill pi-delegator -a claude-code`. Or copy the skill folder (skills/pi-delegator in luongnv89/pi-extensions) into .claude/skills/pi-delegator in your project. Claude Code loads it when a task matches its description.

How do I install Pi Delegator in Codex?

Run `npx skills add luongnv89/pi-extensions --skill pi-delegator -a codex`. Or copy the skill folder (skills/pi-delegator in luongnv89/pi-extensions) into .agents/skills/pi-delegator in your project. Codex loads it when a task matches its description.

Can I use Pi Delegator in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add luongnv89/pi-extensions --skill pi-delegator -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/pi-delegator, .gemini/skills/pi-delegator, .github/skills/pi-delegator and .opencode/skills/pi-delegator in your project.

What does Pi Delegator need to run?

Going by SKILL.md and its folder, Pi Delegator needs Python for the scripts in its folder and the command-line tools its instructions call (git and python3). Our summary lists: Python 3.

Does Pi Delegator access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Pi Delegator safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Pi Delegator use?

Pi Delegator is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Pi Delegator use?

About 1.6k tokens (SKILL.md is roughly 6.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1k tokens, read only when the agent opens those files.

What are the alternatives to Pi Delegator?

Skills that share tags, products or a category with Pi Delegator: Delegate Setup (sickn33/agentic-awesome-skills, 47k stars), Delegate Work (paperclipai/paperclip, 99k stars), Operator Approval Loop (affaan-m/ECC, 276k stars) and Event Delegation (thedaviddias/Front-End-Checklist, 74k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Pi Delegator?

luongnv89 (a GitHub user) maintains it in luongnv89/pi-extensions, which has 140 GitHub stars. The repository was last updated on September 28, 2026.

Source: luongnv89/pi-extensions on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.