Archived. This project now lives in Phimacs as
packages/extensions,packages/orchestrationandpackages/pimux.
Pi extensions for development work, in two packages that install separately:
- The root package: safety lints,
ask,/tools, session tools, workflows and skills. orchestration/:do,delegate,fresh_look, shell panels andwaiton tmux, Herdr, Emacs/Pilish or the Tau web server.
Needs Pi and Node. Pi resolves its own imports from the installed CLI, so
do not run npm install in either package.
git clone https://github.com/offline-ant/pi-ant
(cd pi-ant/extensions/copy-quote && npm ci --ignore-scripts)
pi install ./pi-ant/orchestration
pi install ./pi-antThe npm ci line is required: /copy-quote has its own small dependency package,
and Pi reports a load error without it. Restart Pi or run /reload afterwards.
The replaced backend packages and legacy semaphore/Claude bridge tools are removed.
Emacs startup must load orchestration/emacs/pi-orchestration.el in Pilish's
use-package :config before the first Pi spawn. The companion owns host/server
identity and C-M-f; the separate Pilish checkout contains only generic session
APIs, RPC input/settlement, and editor dialogs. See the linked orchestration README.
These are the pi tools registered by this package:
ask— ask the user interactive multiple-choice or free-form questions. In TUI and RPC sessions, each question also offersFork (discuss separately): edit a discussion prompt, launch an inherited session on the selected host, then return to the unchanged question and answer it.document_flow_review— read one document strictly in sequence without lookahead and assess its internal coherence, including logical flow, definitions, transitions, expectations, internal contradictions, and misplaced or late information. It does not verify factual truth or external validity. The tool is inactive by default and can be exposed through/tools.- Core
editandwriteare wrapped bylintsto display post-write safety warnings. Itseditguideline steers file changes away from bash.tychecks a PEP 723 script in the environmentuvselects for it, andunresolved-importwarnings explain how to expose dependencies. Focused test:node scripts/test.mjs extensions/lints.test.ts. self_compact— the agent callsself_compact({note})alone in its tool batch at a clean checkpoint. Its normal TUI tool display shows the full handoff note as arguments stream in, without requiring expansion. The run ends, Pi's native compaction runs (normal summary prompt, model, andkeepRecentTokensretention), and the note is then delivered verbatim as the next message, which continues the work without a human prompt. Structured workers retain automatic completion across this handoff; their eventual result and retrospective return normally. It does not retry: failure, cancellation, or a skipped handoff is reported and work stops; an unfinished worker waits for a human (a saved main result is preserved if its retrospective fails). From 69% context usage, a generic reminder without usage numbers is added to each model request but not displayed or saved in the session. Tool guidance and reminders tell the agent to finish withoutself_compactwhen the original user request is nearly complete. The reminder also says to continue when all current context is needed, and to compact when much of it is irrelevant. Native/compactand automatic-compaction settings are unchanged. The tool is off unless enabled through/tools. Adapted from disler/self-compact-pi-agent (MIT). Focused test:node scripts/test.mjs extensions/self-compact.test.ts.present_guidance— validates structured guidance output for guidance-mode final answers. It is only registered forPI_GUIDANCE=trueruns or dynamically inside/ugoguide-phase sessions.
When a run ends in an error nothing else recovers from, error-prompt opens a standard dialog with
the error: Continue sends continue; Type my own reply or cancelling leaves you at the input.
It reaches every frontend as a normal extension dialog, so a pi-deck session turns blocked and pings, and it
emits herdr:blocked while open.
It runs at agent_settled, after Pi's retries and compaction, and skips your own aborts, sessions without
UI and work already queued. Anything that starts a new run closes the dialog. It never retries by itself.
Workers ask too, on top of their waiting state: Continue resumes the worker and reaches the parent as user
guidance. An extension whose failed run must not ask sets claimed on pi-orchestration:error-claim at
agent_end; the worker frame does this for retrospectives and early hand-backs.
Browser automation and web retrieval are provided by the separately loaded
pi-browser package, not this package. It registers
browser, web_search, web_fetch, and web_read, sharing its core and web-tool factories
with the standalone pagent application. PI_WEB_BACKEND=auto (default) prefers
Codex and reports browser fallback when unavailable; codex and browser select
strict backends. Backend selection is host configuration, not a tool argument.
After /reload, run /copy-quote in a terminal Pi session. It reads the latest
completed assistant response on the current branch. One nonempty blockquote copies
immediately; several open a numbered picker. Escape cancels without copying; no
quotes produces a notification rather than falling back to an older answer.
Nested quotes are included in their enclosing quote, with all quote markers removed.
Internal Markdown (including code fences), literal >/|, code indentation, and
source line breaks are preserved. The display and history do not change, and normal
mouse copying is unaffected. Pi's clipboard helper retains its platform and OSC 52
behavior. RPC/print modes are refused to avoid writing the server's clipboard.
The extension's small isolated dependency package uses micromark's concrete source positions; Pi's bundled Marked tokens do not reliably retain source spans. After cloning or deploying, hydrate only that package (no Pi peers are installed):
cd extensions/copy-quote && npm ci --ignore-scriptsChecks from the pi-ant root, without model calls or touching the real clipboard:
node scripts/test.mjs extensions/copy-quote.test.ts
npm run checkInside a Herdr Pi TUI, while this Pi is idle:
/start-tab-finish Review the changes and run the tests
/start-space-finish Check the combined work across this workspace
/start-finish-cancel
The first two commands wait, without model calls, until all other recognized
agents in the caller's tab or workspace are idle or done, then submit the
prompt once to this Pi. They do not create a tab, workspace, or session. Herdr
change events trigger fresh checks of the live scope: late arrivals and agents
that become busy again count; agents that leave no longer count. Ordinary shells
are ignored. working, blocked, and unknown prevent starting. No other agents
means the prompt can start immediately.
Waiting Pi sessions report blocked through the installed Herdr Pi integration
(herdr:blocked). Two waiters in each other's scope deliberately block each other;
cancel one to release the other. The integration must be active and its blocked
report must be observed before a prompt can start. The widget shows the pending
prompt and remaining agents. Only one prompt may be scheduled at a time.
Cancellation, another submitted prompt, this Pi starting work, branch/session changes, reload, exit, connection failure, or the caller leaving its scope clear the wait. Waits are not persisted or automatically retried. Submission uses Pi's local message API and preserves human drafts. This is a live readiness check, not an atomic scheduler or proof that the other agents succeeded. Commands are absent outside Herdr and in RPC/print/JSON mode.
Focused checks from this directory:
node scripts/test.mjs extensions/herdr-finish.test.ts extensions/herdr-finish-client.test.ts
PI_HERDR_FINISH_NATIVE=1 node scripts/test.mjs extensions/herdr-finish-native.test.tsThe opt-in native test creates only disposable Herdr topology and real Pi TUIs with faux inference; it never makes paid model calls or changes existing panes.
The package exports skills/. After /reload or in a new session, invoke
/skill:herdr or ask the agent to use the skill. Other agents can read
skills/herdr/SKILL.md directly.
herdr— local guidance for Herdr 0.9.0 CLI operations, with ownership safeguards and a separate managed Pi orchestration workflow.
Verify package skill discovery without model calls:
node scripts/test.mjs scripts/skills.test.ts- Document flow review command:
/document-flow-review <document-path> [--profile <reader profile>]runs a persistent isolated agent with no discovered context, skills, prompts, extensions, or built-in tools. The agent-callabledocument_flow_review({ file, prompt? })tool is inactive by default and can be enabled through/tools, so it consumes no model context until selected. Both entry points reveal Markdown in visually coherent 3–6-sentence reading units and assess whether each unit follows coherently from what preceded it. They show each consumed source unit with its recorded friction and current reader thinking/output, then save the full session, metadata, and final review underscratch/document-flow-review/in the active working directory. This review concerns the document's internal consistency and sequence, not the factual truth or external validity of its claims. Slash-command results are inserted into the current agent context; tool results enter it normally as tool output. - Vim conversation edit command:
/vim— opens the current conversation transcript in$VISUAL/$EDITOR/vim; changed lines are sent as the next user message. - Working-directory switch command:
/cwd <path>. - Git commit command:
/git-commit [message]runsgit add -A && git commit -m <message>, defaulting toauto. - Git worktree creation command:
/worktree <name>. - Execution safety toggle:
/exec-lints. Besides git and pipe-tail guards, it blocks the first standalone localgrepinbash(pointing torg; the built-ingreptool is disabled, and an identical retry passes) and a localsleepof 6 seconds or more, or anysleepinside a shell loop, inbashandpanel-sendcommands, pointing to the orchestrationwaittool. The first localbashcommand per chat that rewrites a file with inline Python,sed -i,perl -i, or acat/teeheredoc is blocked with a reminder to useeditorwrite; every later one passes. Commands of 120 characters or more skip every lint except the git guards and this reminder. - Codemode delegation:
/codemode-delegatetoggles whether activedo,delegate, andfresh_looktools are callable from scripts and other tools. Supportson,off, andstatus; saved globally, off (model-only) by default. Nesteddoinherits the conversation before the outer tool call, not script-local findings. See orchestration for context and recovery limitations. - Alternate delegate model:
/delegate-altchooses a globally saved model pair or disables alternate selection. Disabled by default, with no required configuration file. Choosing immediately adds/removes optionalaltfrom the actual schemas and descriptions ofdo,delegate, andfresh_lookwithout a reload; omitted/false retains the caller's model, true selects the other configured model (or the first if the caller is outside the pair)./delegate-alt offdisables it;/delegate-alt statusreports the selection. See orchestration. - Tool configuration:
/toolsopens a branch-persistent toggle list in TUI or standard RPC dialogs that enables or disables individual tools immediately. Ctrl+S (RPC: Save as default) saves the exact current selection as{"enabledTools": [...]}in~/.pi/agent/tool-selection.json, the global default for branches without their own selection. Without a saved default, Pi's own active tool set is left unchanged. The selection is applied at session start, on branch changes, and on edits; before each prompt it is reapplied only if it changed (for example a default saved by another session, or Ugo control ending). Tools Pi activates itself in between stay active until the selection changes again:codemodeortool_searchenabled when an MCP server connects, toolstool_searchloads, and direct MCP tools. Selected tools that register later, such as those of a server that connected after startup, are activated. The list opens on the actual active tools, so toggling keeps Pi's activations.do({task})is the preferred worker tool: it continues from the current conversation in the current directory, so the task is a brief goal.delegate({task, folder?})is the occasional exception for a large standalone assignment; its worker sees project instructions but no conversation, so the task must be a complete brief.fresh_look({task, folder?})starts without conversation or discovered instructions; it is disabled at startup and is enabled manually in/tools. Independent siblingdo,delegate, andfresh_lookcalls execute concurrently and join before the parent continues. Structured workers receive the caller's active tools that are available in the child, plusdo. A worker that tries to start another worker as its first tool call receives a one-time warning before retries are allowed. Ugo keeps its own tool control;present_guidanceremains required when registered. - Workboard command/context:
/new-workboardcreatesworkboard.md; whenworkboard.mdexists in the current working directory, it is autoloaded into agent context as active operational state./new-workflowcreates editableworkflow.mdguidance policy;/ugoand guidance mode also create it when missing. Cold ideas/backlog items belong in project files outsideworkboard.mduntil promoted toneeds-enrichmentorready. - AGENTS.d auto-loading: before every agent start, discovers
AGENTS.d/in the current directory and every ancestor through the filesystem root, without stopping at repository boundaries. Like Pi'sAGENTS.mdancestor traversal, content is concatenated outermost-first, with the current directory last; a local directory is not required and same-named files from different ancestors are all retained. Each directory's top-level files and file-target symlinks load alphabetically. File paths, tree roots, and notifications are relative to the current directory, distinguishing inherited sources. Subdirectories are listed in trees at the end of the injected block but their contents are not loaded. Symlinks show their resolved real path; dangling symlinks appear only in the tree listing. Discovery and contents refresh each run, including after cwd changes. This is ancestor inheritance only: no separate global config-directory lookup or Markdown-specific override/worktree-shadowing rules. Focused test:node scripts/test.mjs extensions/agents-d.test.ts. - Guidance mode:
PI_GUIDANCE=true pi -p "inspect workboard.md and present_guidance"loads editableworkflow.mdguidance policy and requires a structuredpresent_guidanceresult.bin/pi-guidance-looprepeatedly runs guidance, executesCONTINUE_WORKprompts, appliesUPDATE_WORKworkboard updates, and stops onREQUIRE_HUMAN_DECISIONorEMPTY_WORKBOARD. - Ugo workboard loop:
/ugoalternates ugo-guide and ugo-do phases in fresh sessions untilREQUIRE_HUMAN_DECISION,EMPTY_WORKBOARD, commit failure, Escape, or/ugo-pause. Ugo createsworkflow.mdwhen missing and loads it as editable guidance policy for guide phases. Ugo requires a clean git worktree except forworkboard.md,workflow.md, andscratch/, and commits changed files after each ugo-guide/ugo-do phase with the prompt, result, and automatic no-tools ugo-do reflection in the commit message. The reflection hasRetrospectiveandSimplifynotes; the complete reflection is injected into the next ugo-guide prompt so guidance can promote relevant improvements into workboard updates/items. Human-decision phases watchworkboard.mdandscratch/decisions/*forDONE:orCLARIFY:signals, apply the resulting workboard transition, and continue. Empty-workboard phases remain active and watchworkboard.mdfor new work without creating decision artifacts./ugoalso resumes paused, human-decision, or empty-workboard state;/ugo-pausestops watchers immediately or pauses after the active phase safely checkpoints. SeeHOWTO-UGO.md. #prompt snippets:#principles,#cut,#simplify,#delegate-review,#ts,#delegate-progress,#supervise,#api-review,#enrich,#distill.