@mzwing/pi-session-hub

Lists, reads, messages and starts independent Pi sessions

Packages

Package details

extension

Install @mzwing/pi-session-hub from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@mzwing/pi-session-hub
Package
@mzwing/pi-session-hub
Version
0.3.1
Published
Oct 18, 2026
Downloads
747/mo · 352/wk
Author
mzwing
License
MIT
Types
extension
Size
63.4 KB
Dependencies
0 dependencies · 3 peers
Pi manifest JSON
{
  "extensions": [
    "./dist/index.js"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

@mzwing/pi-session-hub

npm

A Pi extension that lets the Pi sessions on one machine find, read and message each other, and start independent headless sessions.

Install

pi install npm:@mzwing/pi-session-hub

Requires Pi 1.3.0 or later.

Usage

The model gets four tools:

Tool What it does
session_list Lists the running sessions on this machine and the recent sessions of this project
session_read Shows another session's conversation as its model sees it
session_send Messages a running session, starting a turn there unless wake is false
session_spawn Starts a headless pi --print session that outlives this one, or continues a stopped one with resume

/sessions shows the same list as session_list, and /sessions <id> a session's transcript.

Messages wait in a queue under ~/.pi/agent/pi-session-hub/, so one that reaches a headless session after its run has ended is read when that session next starts. A spawned session writes its output to ~/.pi/agent/pi-session-hub/logs/<id>.log.

A spawned session runs headless, so @gotgenes/pi-permission-system denies whatever would ask. Give it rules without asks, or add @mzwing/pi-permission-auto-review to the authorizer chain.

Programmatic use

Other extensions message and start sessions through @mzwing/pi-session-hub/api, whose exports are listed in src/api.ts.

Credits

Spawned sessions re-invoke Pi the way getPiInvocation does in Pi's subagent example.

License

MIT