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-harness/plugin-session-compare

v0.1.36

Published

Compare two persisted Pi sessions by message role and text without modifying either session file.

Readme

@pi-harness/plugin-session-compare

Session Compare — Compare two persisted Pi sessions by message role and text without modifying either session file.

Install

npm install --save-exact @pi-harness/plugin-session-compare

Enable

Add the entry to the Cordis profile the harness starts from:

- id: session-compare
  name: "@pi-harness/plugin-session-compare"
  config: {}

The Pi Harness plugin marketplace installs and enables this package for you; the steps above are the manual equivalent.

Comparison scope

Comparison is positional across non-empty text messages in journal order, including entries from historical branches. It trims text boundaries and compares role plus full normalized text; an insertion shifts later positions and can count the following messages as changed. It is not an edit-distance or active-branch comparison. Images, tool-call arguments, custom messages, metadata and empty text are excluded: matching text projections do not prove identical sessions.

Full added/removed counts are returned separately from previews (40 per side, 4,000 UTF-16 code units each), with explicit truncation flags covering both omitted messages and cropped text. Shared messages are compared in full and do not trigger preview truncation. The panel displays at most four previews per side and warns when the tool's previews were truncated; the tool text includes the same warning. Any session in the active SDK session directory can be selected by exact ID, full path or filename, including older sessions beyond the first 200 results and legacy headers without cwd or timestamp. Explicit filenames and full paths resolve directly through the authoritative selected-file reader; fallback ID discovery streams the directory and reads at most the 64 KiB first-line header from each regular nonsymlink JSONL file, without retaining a full inventory or silently capping its size. Each selected file is read through a bounded 4 MiB reader, rejecting invalid UTF-8, malformed JSONL, files from another declared workspace and files whose discovered session identity changed before reading. The files are independent snapshots, not an atomic pair; avoid editing them while comparing.

When a shorthand name resolves to an existing malformed JSONL file, the comparison reports a bounded malformed-file diagnostic instead of masking the parse failure as a missing session. Unrelated malformed files encountered during fallback directory discovery remain skippable.

Cancelled and disposed requests do not replace the last successful report in the same session. Native session changes clear the cached comparison; stale requests cannot publish into the new session. The session is captured before parameter inspection. Discovery checks cancellation between directory entries and bounded header chunks; selected-file reads check the signal between chunks so large files do not continue scanning after cancellation. Reports returned to tools and panels do not share mutable state.