@e9n/pi-telemetry

Local telemetry extension for pi — captures session events and writes to disk

Package details

extension

Install @e9n/pi-telemetry from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@e9n/pi-telemetry
Package
@e9n/pi-telemetry
Version
1.0.1
Published
Apr 26, 2026
Downloads
169/mo · 156/wk
Author
e9n
License
MIT
Types
extension
Size
14.5 KB
Dependencies
0 dependencies · 1 peer
Pi manifest JSON
{
  "extensions": [
    "./src/index.ts"
  ]
}

Security note

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

README

@e9n/pi-telemetry

Local-only telemetry extension for pi — records lightweight, privacy-safe events to per-day JSONL files. No prompts, completions, or file contents are ever written.

Features

  • Event recording — session, model call, tool call, and config change events
  • Privacy-safe — only numeric/enum/hashed fields; no user content
  • Per-day JSONL files — written to ~/.pi/agent/telemetry/
  • /telemetry command — toggle mode and level at runtime

Settings

Add to ~/.pi/agent/settings.json:

{
  "telemetry": {
    "mode": "on",
    "level": "INFO"
  }
}
Setting Values Default Description
mode "on", "off" "on" Enable or disable telemetry
level NONE DEBUG INFO WARN ERROR CRITICAL "INFO" Minimum level to record

Events

Event Level Fields
session_start INFO agentVersion, cwdHash
session_end INFO reason, durationMs
model_call INFO/WARN provider, modelId, turnIndex, error
tool_call INFO/ERROR toolName, durationMs, error
config_change INFO provider, modelId, source

Events are written as JSONL to ~/.pi/agent/telemetry/YYYY-MM-DD.jsonl.

Commands

Command Description
/telemetry Show current mode and level
/telemetry on Enable telemetry
/telemetry off Disable telemetry
/telemetry on WARN Enable, recording WARN and above only

Install

pi install npm:@e9n/pi-telemetry

License

MIT