pi-reporter
Puts every Pi session on the dashboard, observe-only. It is a Pi extension that runs inside each pi process (Pi 1.6.1 or
later), as the Claude Code plugin runs inside Claude Code, and posts one report per session with codex-reporter's transport,
machine identity, redaction and git readers (imported from codex-reporter/src/). It calls no Pi action, registers no tool,
command or shortcut, writes nothing into the session, and the dashboard cannot answer its sessions or send them a message or
command.
scripts/install.ts --pi writes one file, ~/.pi/agent/extensions/sitrep-reporter.ts (under $PI_CODING_AGENT_DIR when that
is set), which loads src/index.ts from this clone, and the settings file ~/.sitrep/pi-reporter.env. No Pi setting is
read or written. Sessions started afterwards report; an open one reports after /reload in it. git pull in the clone
updates every session at its next start or /reload. scripts/uninstall.ts --pi removes the file.
What it reports
Pi's rules are cited in src/index.ts (pi 1.6.1).
| Report | From Pi |
|---|---|
provider, reporter.name | pi, pi-reporter; engineVersion is Pi's version |
| which sessions | the session of each pi process from its first user or assistant message, Pi's own test for writing a session file: a pi opened and quit sends nothing |
reporter.hostSurface | terminal (the TUI), headless (pi -p, --mode json), rpc |
session.id, name | Pi's session id; Pi's session name, else the first prompt, redacted and cut, else the folder |
status | running while Pi runs (from a run's start to its settling) or compacts; waiting on permission while a confirm dialog waits in the terminal, on input while a select, input or editor dialog does, the dialog's first line as the note; else idle. done when Pi quits or switches session (new, resume, fork), with that reason |
model, effort, context | Pi's model, thinking level and context fill, as its footer shows them |
usageByModel | every entry's tokens, every branch, as Pi's /session totals them: a response under the model that answered, compactions and branch summaries under the model in effect, a tool's own usage under unknown (unpriced). Long above 100K prompt tokens for Claude, 272K otherwise |
loop, toolOpen, toolFailures | tool calls and model requests from every entry; the newest call; a call open; failed calls in a row |
blowouts | compactions at Pi's threshold or on overflow seen by this process; unknown for a session that compacted before |
git, files | read in Pi's folder every 10 s, files counted from the commit at the extension's start |
events | file edits, compactions, a dialog's wait, a run that ended in error (Pi's first error line) |
rows (the record) | a turn per Pi run, a request per model response, a call per tool call with its outcome and exit code; text only at full capture, redacted on the machine |
respond | off, limit observe-only: the panel reads "Answer in pi" |
| everything else | unknown or empty: cost (the server prices the usage), plan windows, plan, skills, agents |
Configuration
~/.sitrep/pi-reporter.env, read with Node's own env-file parser, never put into the environment Pi gives its commands:
PI_REPORTER_SERVER_URL: the dashboard server (defaulthttp://127.0.0.1:7487)PI_REPORTER_TOKEN: the admin secretPI_REPORTER_CAPTURE:off,trace(rows without text, the default) orfull(rows with their text); any other value reports nothingPI_REPORTER_ACTIVITY_FEED: on unlessoff,falseor0
Reports go over node:http, never through Pi's proxy settings. Problems go to ~/.sitrep/pi-reporter.log, each line
starting with its UTC time; nothing is written to Pi's terminal.
Limits
- Not seen: sessions started with
--no-extensions, by an SDK host with its own resource loader, or on a Pi below 1.6.1 (the log says so). - A question built on a custom component shows no Needs you, as Pi's own terminal status does not; a dialog opened inside one is not seen either.
- A
/reloadmid-run leaves that turn without an end; a dialog already open at a/reloadis seen only at its end; the files' base starts again at HEAD. - A Pi killed without its shutdown (SIGKILL, a crash) leaves its card to the server's 75 s silence timer. The last report waits at most 1 s; rows it cannot carry in that time are lost.
- A fork's first report carries the usage copied from its parent; the server books nothing twice.