@ai-devkit/pi-session-tracker

Pi extension that tracks active sessions by PID in a shared JSON registry (~/.pi/agent/sessions.json)

Packages

Package details

extension

Install @ai-devkit/pi-session-tracker from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@ai-devkit/pi-session-tracker
Package
@ai-devkit/pi-session-tracker
Version
0.1.0
Published
Jun 10, 2026
Downloads
not available
Author
codeaholicguy
License
MIT
Types
extension
Size
2.6 KB
Dependencies
0 dependencies · 1 peer
Pi manifest JSON
{
  "extensions": [
    "./extensions"
  ]
}

Security note

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

README

@ai-devkit/pi-session-tracker

A Pi extension that tracks all active Pi sessions in a shared JSON registry at ~/.pi/agent/sessions.json.

What it does

  • On session start — registers { pid: sessionFilePath } in the registry
  • On session shutdown — removes the pid from the registry

The registry always reflects currently-running Pi sessions:

{
  "12345": "/Users/you/.pi/sessions/abc123.jsonl",
  "67890": "/Users/you/.pi/sessions/def456.jsonl"
}

Install

pi install npm:@ai-devkit/pi-session-tracker

Or try it without installing:

pi -e npm:@ai-devkit/pi-session-tracker

Registry location

~/.pi/agent/sessions.json

The directory is created automatically if it does not exist.

Use cases

  • Multi-agent orchestration — discover and communicate with other running Pi processes
  • Session dashboards — know which session files are actively in use
  • Tooling integrations — external scripts that need to find the current Pi session file