@volh/pi-network-monitor

Network request monitor for pi agent — live overlay showing all HTTP traffic

Package details

extension

Install @volh/pi-network-monitor from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@volh/pi-network-monitor
Package
@volh/pi-network-monitor
Version
0.1.0
Published
Mar 2, 2026
Downloads
23/mo · 7/wk
Author
volh
License
MIT
Types
extension
Size
20.9 KB
Dependencies
0 dependencies · 2 peers
Pi manifest JSON
{
  "extensions": [
    "./index.ts"
  ]
}

Security note

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

README

pi-network-monitor

Network request monitor for pi coding agent.

Shows every HTTP request that pi and its extensions make — LLM API calls, web searches, content fetches, auth flows — in a live overlay. Useful for understanding what's happening on the network, debugging slow requests, and seeing the full request chain behind tools like pi-web-access.

How it works

Uses Node.js diagnostics_channel to subscribe to undici's request lifecycle events. Since pi and all extensions run in the same Node.js process and use the global fetch(), this captures everything with zero monkey-patching.

Install

pi install npm:@volh/pi-network-monitor

Or from git:

pi install https://github.com/volh/pi-network-monitor

Requires pi v0.37.3+. No dependencies.

Usage

Open with Alt+N or /network.

List view

Each line shows method, status code (color-coded), host + path, and duration.

Key Action
↑/↓ or j/k Scroll
PgUp/PgDn Jump 10 entries
Home/End Jump to top/bottom
Enter or d Detail view
f Host filter
c Clear history
Esc Close

Detail view

Full URL (wrapped), HTTP status, TTFB, total duration, timestamps with millisecond precision.

Host filter

Press f, start typing to search (e.g. antapi.anthropic.com). Matching substring highlighted. Hosts sorted by request count. Enter to apply, Esc to cancel.

Configuration

~/.pi/network-monitor.json:

{
  "shortcut": "alt+n",
  "anchor": "center",
  "width": "60%",
  "maxHeight": "80%"
}
Key Default Description
shortcut alt+n Keyboard shortcut
anchor center Overlay position (center, right-center, top-right, etc.)
width 60% Overlay width (percentage or columns)
maxHeight 80% Maximum height

What gets captured

Every fetch() call in the pi process — LLM API calls (any provider), search APIs, content fetches, auth flows, extension traffic. Per request: method, full URL, status code, TTFB, total duration, errors. Stores last 500 requests in memory, not persisted.

License

MIT