← Catalog

@maxpaulus/pi-rex-agents

Named pi subagents in Rex panes: splits, floating panes, or other Rex hosts.

Package

Install

Install with PiG

pig install npm:@maxpaulus/pi-rex-agents

Install with Pi

pi install npm:@maxpaulus/pi-rex-agents
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "extensions": [
    "./index.ts"
  ]
}

README

Written by the package's publisher, shown as published in version 0.2.2 (README.md). PiG does not review it.

pi-rex-agents

Named pi subagents that run in Rex panes. Each agent is a normal interactive pi, so you can click into its pane and talk to it.

Install

From the repository root, run:

pi install "$PWD"

For agents on another Rex host, install it there too. Update both hosts together so they use the same result handoff format.

Tools (for the master agent)

ToolWhat it does
agent_spawnStarts a named agent in a separate interactive terminal and returns at once. Override the layout with split, float, or window.
agent_sendTypes a message into a running agent's pane, or resumes a settled agent with it.
agent_listLists agents and agent definitions.

Agents in the current session start in named, minimized floating panes by default. Agents on another host or outside the current session default to a separate window.

Pi shows active agents and their status in the Agents row above the input. In fullscreen mode, click an agent to restore and focus its pane. Results and questions arrive automatically.

Agent files

The extension reads one markdown file per agent from agents/ in this package, ~/.pi/agent/agents/, and .pi/agents/ in trusted projects. A later file with the same name wins.

---
name: scout
description: Fast read-only recon
kind: scout            # scout = read-only tools + web; worker = every tool
# model: provider/model  # optional; defaults to the parent agent's model
thinking: low          # optional
tools: read, grep      # optional allowlist that replaces the kind's default
---
System prompt and personality.

How it uses Rex

  • Spawn: session.new_split, session.new_layer, or session.new_window with pi --session-id <id>. Remote agents go into a pi-agents session on the host.
  • Status: pi reports OSC 7501 program status. The parent follows rex events for program_status_changed and block_closed.
  • Child asks parent: the child's ask_parent opens a pi input dialog, so pi reports blocked/question with the question. The parent answers with rex send + send-key enter.
  • Settle: when a child settles, it writes its last reply to a handoff file in ~/.pi/agent/rex-agents/ and exits. The parent removes the file after the full reply is recorded in its session. Session history stays available for resume. It stays open if the run was aborted or if it still waits on its own subagents. A pane waiting on ask_parent has not settled, so it stays open too.
  • Resume: start the agent again with the same --session-id.