npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

pi-trajectory

v0.1.4

Published

Trajectory For All — a browser-based inspection surface for pi coding agent sessions.

Readme

Pi Trajectory

A browser-based inspection surface for pi coding agent sessions, inspired by the Trajectory feature in DeepSeek Harness. Browse every session you've ever run, then drill into turns, tool calls, outputs, usage, model changes, compactions, and prompt snapshots — all in a timing-aware visual ledger.

Pi Trajectory inspector

Trajectory is local-first, read-only, and replay-only. It never sends data anywhere, never modifies session files, and never controls a running agent. It reads the JSONL files pi already writes to ~/.pi/agent/sessions/ and projects them into an interactive timeline.


Install the extension

The extension gives you a /trajectory slash command inside pi and logs prompt snapshots for the inspector:

pi install npm:pi-trajectory
# or from git:
pi install git:github.com/ktappdev/pi-Trajectory

Reload pi. Then inside any session:

/trajectory           # open the current session in Trajectory
/trajectory <id>      # open a specific session by id or uuid prefix

The command opens your browser to the session's trajectory page.

The inspector needs a server. The extension is just the slash command + prompt logger. The visual inspector (server + web UI) runs separately — clone this repo and start it:

git clone [email protected]:ktappdev/pi-Trajectory.git
cd pi-Trajectory
pnpm install
pnpm dev    # development (Vite + API on 127.0.0.1)
# or: pnpm start  (production, built UI + API on 127.0.0.1:8787)

If the server isn't running, the /trajectory command tells you how to start it. Set PI_TRAJECTORY_PORT to override the default port (8787).


What you get

  • Session picker — searchable list of every pi session, all projects, with message counts and first-message previews
  • Three-lane timeline — input, model, and tool activity projected onto a single sequence overview. Drag to focus a region, right-click to clear. Click any block to jump straight to it in the ledger.
  • Virtualized ledger — every turn, tool call, and assistant message as a row. Filter by search, fold turns and tool groups, see usage and timing at a glance.
  • Inspector — click any record to see full detail: tool input, output, parameter schemas, usage breakdown, raw JSONL, and prompt anatomy.
  • Prompt anatomy — when the extension is installed, each system-prompt change is hash-gated and logged with its sections (custom prompt, guidelines, skills, context files) and active tool catalog.
  • Loopback only — server binds to 127.0.0.1. No network exposure, ever.

Production build

pnpm build
pnpm start

Serves built UI and API at http://127.0.0.1:8787.

Verify

pnpm typecheck
pnpm test
pnpm build

API

| Endpoint | Description | |----------|-------------| | GET /api/health | Server health check | | GET /api/sessions | All sessions, newest first | | GET /api/sessions/:id | Projected trajectory snapshot | | GET /api/sessions/:id/raw | Parsed raw JSONL entries |

Session IDs, session-relative paths, and absolute paths under pi's sessions directory all resolve safely. Anything outside it is rejected.

How it works

Trajectory reads pi session JSONL files, parses them with pi's own parseSessionEntries + buildContextEntries, and projects the active branch into a TrajectorySnapshot — a pi-free data model shared between server and web client. The web client never imports pi types; it only consumes @pi-trajectory/shared.

Replay intentionally leaves per-operation durations empty: pi session JSONL does not persist per-token timing. Live inspection is future work.

Contributing

Found a bug, have a fix, or want to improve the inspector? Contributions are welcome.

  1. Fork the repository and create a focused branch.
  2. Make your change and add a small test when behavior changes.
  3. Run pnpm typecheck, pnpm test, and pnpm build.
  4. Open a pull request with what changed and how you verified it.

Small fixes, UI improvements, documentation updates, and ideas are all useful. For larger changes, open an issue first so direction stays aligned.

Privacy

Trajectory is read-only and local. It does not:

  • Send session data anywhere
  • Modify session files
  • Expose a network host
  • Control a running agent

The extension logs full system prompts (including project context) to session JSONL. Treat session files as sensitive local data. Only install the extension where local session logging is appropriate.

Requirements

  • Node 22.19+
  • pnpm
  • pi with session files under ~/.pi/agent/sessions/

License

MIT