Run and manage multiple Pi coding agents from one Pi session.
Pi Supervisor uses tmux to keep Pi sessions running in the background. It watches their terminal output, shows which agents are working or waiting, and wakes your current Pi session when an agent needs attention.
You do not need any other supervisor extension. Pi Supervisor works on its own.
- Run several Pi agents side by side, each with its own model and project directory.
- Monitor sessions for working, idle, dialog, and missing states.
- Notify the supervising Pi when an agent finishes or asks a question.
- Capture a supervised session's recent output.
- Send follow-up instructions to a specific agent.
- Start new Pi sessions directly from Pi and mark them as supervisor-managed.
- Close validated completed agents instead of leaking tmux sessions.
- Auto-close clean, unattached managed sessions after a 30-minute idle grace period.
- Preview and interactively clean up completed legacy Pi sessions.
- Show a persistent status widget in the Pi footer.
- Warn and require explicit approval before responses to potentially dangerous dialogs.
- Restore your monitored sessions after Pi reloads or resumes.
- Pi installed and available as
pi. - tmux installed and available as
tmux. - At least one Pi model configured and authenticated.
Check that both commands are available:
pi --version
tmux -VInstall from GitHub:
pi install git:github.com/ygncode/pi-supervisorRestart Pi or run /reload after installation.
To try it without installing permanently:
pi -e https://github.com/ygncode/pi-supervisorFrom your main Pi session, run:
/pi-spawn -m <model> -n code-review -d ~/project
For example:
/pi-spawn -m openai-codex/gpt-5.6-luna -n code-review -d ~/project
Use a model available in your own Pi configuration. The new agent starts in a detached tmux session and is supervised automatically.
If a Pi session is already running inside tmux:
/pi-supervise <tmux-session-name>
To see available tmux sessions:
/pi-supervise
If there is more than one session to choose from, Pi shows a selector.
/pi-supervise status
/pi-send code-review :: Run the tests and report any failures.
/pi-supervise close code-review
close succeeds only for an unattached supervisor-managed session that is idle and does not show a dialog or unresolved failure. The supervising model is also instructed to close an agent after validating successful completion.
When only one session is supervised, the session name is optional:
/pi-send Run the tests and summarize the result.
| Command | Description |
|---|---|
/pi-supervise |
Choose an existing tmux session to monitor |
/pi-supervise <session> |
Start monitoring a named session |
/pi-supervise status |
Show state, ownership, and auto-close status |
/pi-supervise close <session> |
Close a validated completed managed session |
/pi-supervise cleanup |
Preview legacy cleanup, then request confirmation |
/pi-supervise stop <session> |
Stop monitoring one session without closing it |
/pi-supervise stop |
Stop monitoring all sessions without closing them |
/pi-send <message> |
Send a message when one session is monitored |
/pi-send <session> :: <message> |
Send a message to a named session |
/pi-spawn -m <model> [-n <name>] [-d <dir>] |
Start and monitor a new Pi session |
Pi can call the pi_supervisor tool to manage sessions without slash commands. It supports:
list— list tmux sessions and identify likely Pi sessionsstart— start monitoring a sessionstatus— get all monitored-session statusescapture— inspect recent output from a sessionsend— send a response or instructionclose— close one validated completed managed sessioncleanup— preview eligible legacy sessions without deleting anythingstop— stop one or all monitors without closing sessionsspawn— start a new managed Pi session with a selected model
Pi Supervisor checks monitored tmux panes every five seconds and reports these states:
| State | Meaning |
|---|---|
working |
The agent is actively processing a task |
idle |
The agent is ready for another instruction |
dialog |
The agent is waiting for a selection, confirmation, or answer |
missing |
The tmux session no longer exists |
The supervising Pi is notified when a session reaches a stable waiting state or finishes a turn. Routine follow-up can be handled automatically, while potentially destructive, deployment, production, credential, or security-related decisions are left for you to approve.
Sessions created by pi-spawn carry tmux ownership metadata. After a clean settled session has remained idle and unattached for 30 minutes, its owning supervisor closes it automatically. Working agents, dialogs, likely questions, unresolved failures, attached sessions, manually started sessions, and sessions owned by another supervisor are preserved.
For older unmarked sessions, /pi-supervise cleanup performs a conservative scan. It lists the exact eligible sessions and asks for interactive confirmation before closing anything. The pi_supervisor cleanup tool is always preview-only.
- All supervised agents must run inside tmux.
- Each agent uses its own Pi configuration, model access, and working directory.
- Messages sent by Pi Supervisor are entered into Pi's single-line input box, so line breaks are converted to spaces.
- Status and unresolved-failure detection are based on terminal output and intentionally err toward preserving sessions.
- Sensitive-dialog protection is reinforced through supervisor instructions; inspect the pane before approving sensitive actions.
- Stopping supervision does not stop or delete the underlying tmux session; use
closefor validated managed sessions. - Automatic cleanup never closes unmarked legacy sessions.
Install tmux using your operating system's package manager, then restart Pi.
Make sure the directory containing the Pi executable is in the PATH inherited by tmux.
Confirm that it exists and that it is a Pi session:
tmux list-sessions
tmux capture-pane -p -t <session-name> -S -40Then run /reload and try /pi-supervise <session-name> again.
Run the classifier and lifecycle tests from a checkout:
npm testAfter changing the extension, run /reload in each already-running Pi process.
MIT