pi-dispatch

pi-dispatch is a skill for Claude Code from musingfox/cc-plugins. It costs 137 tokens per session (3,151 once invoked), scanned B, original, MIT.

A dispatch skill for sending work to background pi workers through named commands such as starting, checking, watching, and stopping a worker. It requires workers to record a one-line completed or blocked result in a file.

In plain words
What is it for?
Use it to run delegated tasks in isolated workspaces, poll their progress, and route completed or blocked work to the next step.
Why use it?
It provides a defined way to delegate work and check its result without extracting a verdict from a worker's conversation log.

Skill for Claude Code

Written for Claude Code: ${CLAUDE_PLUGIN_ROOT} variable. Also seen: reads .claude/ paths; mentions subagents; names the AskUserQuestion tool.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the pi-dispatch plugin — 1 skill, 2 agents shipped together

Good fit Use it to run delegated tasks in isolated workspaces, poll their progress, and route completed or blocked work to the next step.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add musingfox/cc-plugins
Claude Code
/plugin install pi-dispatch

Made for: Claude Code.

Or install pi-dispatch, the plugin that ships this one along with the rest of its 1 skill, 2 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for pi-dispatch

README.md
[![agentmods](https://agentmods.dev/badge/skills/musingfox/cc-plugins/pi-dispatch/github.svg)](https://agentmods.dev/skills/musingfox/cc-plugins/pi-dispatch)
Your own site
<a href="https://agentmods.dev/skills/musingfox/cc-plugins/pi-dispatch"><img src="https://agentmods.dev/badge/skills/musingfox/cc-plugins/pi-dispatch/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for pi-dispatch

Your own site · 80×15
<a href="https://agentmods.dev/skills/musingfox/cc-plugins/pi-dispatch"><img src="https://agentmods.dev/badge/skills/musingfox/cc-plugins/pi-dispatch.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 137 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,151 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00137 $0.03151
Opus 5.5 $0.00055 $0.01260
Sonnet 5.5 $0.00027 $0.00630
Haiku 4.5 $0.00014 $0.00315

Measured 10d ago against content hash 94e1bc045724, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

pi-dispatch scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

4. Ask whether to keep it. On yes, edit `~/.claude/settings.json`: set
pi-dispatch/skills/pi-dispatch/SKILL.md · 222 lines

How it starts

The opening of the file, as written. The whole thing — 222 lines — stays where its author put it; the contents beside it link to each section on GitHub.

pi-dispatch — offload usage

${CLAUDE_PLUGIN_ROOT}/scripts/pi-agent.sh is the name-addressed unified entry point over the pi worker primitives. The registry is the filesystem: $PI_RUNS_DIR/agents/<NAME> symlinks to the run's RUNDIR. Main (the orchestrator) reads this whole file; the ## Operator usage section at the end is what it embeds into a builder brief, and the builder operates those verbs as a pure operator.

How main uses this

  1. Decompose the work into self-contained briefs (one observable outcome each). For code-writing tasks, create one worktree per task, put its ABSOLUTE path in the brief, and launch with PI_CWD=<worktree> ${CLAUDE_PLUGIN_ROOT}/scripts/pi-agent.sh start …. The brief tells the worker where to work; only PI_CWD makes it start there, and it is what arms the worktree fence (git shim + write/edit extension). A fresh dispatch without it is refused (exit 2). To run a worker in the current directory on purpose, say so with PI_CWD="$PWD". Every create flag is required:

    ${CLAUDE_PLUGIN_ROOT}/scripts/pi-worktree.sh create \
      --repo_root <repo root> --branch_name <new branch> \
      --base_ref <BASE_REF sha> --base_branch <branch to diff against> \
      --work_path <worktree path> --diff_out <diff file> \
      --cleanup_out <cleanup script> --rundir-file <rundir file>
    

    It prints the worktree path and appends a cleanup block to <cleanup script>. After start, write the worker's RUNDIR into <rundir file> (start prints it as RUNDIR=…; pipe through sed -n 's/^RUNDIR=//p') so cleanup can kill a live worker; an empty file skips the kill. When the work is merged or dropped, run ${CLAUDE_PLUGIN_ROOT}/scripts/pi-worktree.sh clean <cleanup script>: it saves the diff to <diff file> and removes the worktree.

  2. Embed the ## Operator usage section — from its heading to the end of this file — verbatim, plus the per-task brief, into a builder dispatch. The builder runs ${CLAUDE_PLUGIN_ROOT}/scripts/pi-agent.sh start per task and ${CLAUDE_PLUGIN_ROOT}/scripts/pi-agent.sh watch as its main loop, and runs each worker's acceptance check when it settles.

  3. Terminal status lines persist in the RUNDIR and replay on re-poll; raw stream is kept as pi.stream.jsonl, distilled final text as result.md.

  4. stop NAME once a worker's result is consumed. The registry never self-prunes, and every watch re-prints each of ITS named terminal agents on its first sweep.

  5. watch requires the names because the registry is machine-wide: an unscoped watch would report on — and quota-abort — another dispatch's workers. ls is the global view.

  6. When a batch ends on QUOTA or QUOTA-WINDOW (see the provider wall below), re-dispatch the SAME brief, minus the operator usage, to a Claude builder in self-do mode (${CLAUDE_PLUGIN_ROOT}/docs/main-orchestration.md §6) on the same worktree. One shot: if that fails too, the task is failed.

Read the full file on GitHub · 222 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago Changed · +26 lines · +2 tokens per session 94e1bc045724
  2. 22d ago Changed · +16 lines scan A → B d47f68d9f329
  3. 26d ago Changed · +14 lines 63f90a82b3bb
  4. 1mo ago Changed · +7 lines 7a9110f3cd1b
  5. 1mo ago Changed · -18 lines a82e2cd464fe
  6. 1mo ago Changed · +12 lines fc8d88b390f8
  7. 1mo ago Changed · +7 lines · +64 tokens per session d96db956597f
  8. 1mo ago First seen · 158 lines · 71 tokens per session scan A b4e3ebfcc085

Subscribe to this mod's changes

pi-dispatch is a skill published in the GitHub repository musingfox/cc-plugins (2 stars, last pushed yesterday), licensed MIT. It adds 137 tokens to every session and 3,151 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-05.

Related

Other skills, from other repositories

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 tokens

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens

insight-error-page

Write or audit an insight-kind error page for the Next.js dev overlay. Use when creating a new errors/ .mdx page, auditing an existing one, or checking that a page matches the framework fix cards. Covers page structure, title alignment, FixCard cards with Copy prompt button, code snippets, terminology verification…

vercel/next.js · 83 tokens