pi-observe
Real-time observability dashboard for Pi — event capture, swimlane timeline, token tracking, tool usage stats. Ported from Miessler's PAI Observability system.
Package details
Install pi-observe from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:pi-observe- Package
pi-observe- Version
1.0.0- Published
- Jul 5, 2026
- Downloads
- 165/mo · 10/wk
- Author
- artale
- License
- MIT
- Types
- extension
- Size
- 29.2 KB
- Dependencies
- 0 dependencies · 1 peer
Pi manifest JSON
{
"extensions": [
"src/extension.ts"
],
"commands": [
"observe"
],
"tools": []
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
π-observe — Unified Observability Dashboard for Pi
Real-time observability across Pi sessions, pi-pai events, and Claude Code — all in one dashboard.
Inspired by Daniel Miessler's PAI Observability and Nico Bailon's pi ecosystem.
Install
pi install npm:pi-observe
Usage
/observe # Open dashboard at http://localhost:4040
/observe status # Event counts by source, file size, server status
/observe clear # Rotate log file
Unified Event Sources
| Source | How It Works |
|---|---|
| Pi sessions | Hooks: session_start, tool_call, message_end — captured automatically |
| pi-pai events | Goal changes, ratings, learnings, loop phases — via logPaiEvent() export |
| Claude Code | Scans ~/.claude/projects/ JSONL files every 30s for cross-agent visibility |
| External agents | POST /api/event — any agent can push events via HTTP |
Dashboard Features
- Source filter — toggle Pi / PAI / Claude Code / Subagent events
- Unified timeline — all events chronologically with source indicators (● Pi, ◆ PAI, ◈ Claude)
- Tool usage chart — horizontal bar chart of most-used tools
- Source breakdown — events per source with colored bars
- Stats bar — total events, tool calls, errors, blocked, per-source counts, uptime
- Session info — current session ID, start time, log size
- Auto-refresh — polls every 3 seconds
- Dark theme — because obviously
External Event Ingestion
Any agent can push events:
curl -X POST http://localhost:4040/api/event \
-H "Content-Type: application/json" \
-d '{"type":"tool_call","source":"claude-code","tool":"bash","summary":"npm test"}'
Architecture
Pi Session ─────────────────┐
├─ session_start │
├─ tool_call ├──→ ~/.pi/observe/events.jsonl
└─ message_end │ │
│ HTTP Server (:4040)
pi-pai ─────────────────────┤ ├─ GET / → Dashboard HTML
├─ goal changes │ ├─ GET /api/events → JSON (events + stats)
├─ ratings/learnings │ └─ POST /api/event → External ingestion
└─ loop phases │
│
Claude Code ────────────────┘
└─ ~/.claude/projects/ JSONL scan (every 30s)
Integration with Nico's Ecosystem
- pi-powerline-footer — compatible token tracking format
- pi-coordination — task dispatch/completion events
- pi-review-loop — review iteration events
- pi-subagents — delegation events
License
MIT