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

@dreki-gg/pi-past-chats

v0.3.0

Published

Reference previous pi sessions inline with @chat: and @session: autocomplete

Readme

@dreki-gg/pi-past-chats

Reference previous Pi sessions inline with @chat: or @session:.

Usage

Type either prefix in the Pi editor:

Use the approach from @chat:
Compare this with @session:

Autocomplete shows sessions from:

  1. the current working directory, and
  2. external folders configured in .pi/past-chats.json.

Selecting a suggestion inserts a stable token such as @chat:9ab12cd34ef0. When you submit the prompt, the extension injects a hidden context message with:

  • session title/name
  • session file path
  • cwd/source folder
  • created/modified dates
  • message count
  • deterministic handoff summary
  • optional cached AI handoff summary when enabled

The agent can use the injected summary immediately, or read the listed session JSONL file for deeper details.

Agent tool: search_past_chats

The extension also exposes a tool the agent can call directly to discover relevant prior sessions:

  • Input: query (fuzzy search string) and optional limit (default 10).
  • Scope: the current working directory plus folders configured in .pi/past-chats.json (same index as autocomplete).
  • Output: for each match, the session JSONL file path, a snippet showing why it matched, and a fuzzy score (lower is better), sorted best match first.

The agent then reads any returned path with the built-in read tool to inspect the full conversation. This lets the agent narrow down which past chats discussed a topic before pulling in the detail it needs.

Commands

/past-chats list
/past-chats add <path> [label]
/past-chats remove <label|path>
/past-chats refresh
/past-chats summarize @session:<id>

Examples:

/past-chats add ../api API
/past-chats add /Users/me/work/mobile Mobile App
/past-chats list

Config

Project config lives at:

.pi/past-chats.json

Example:

{
  "folders": [
    { "path": "../api", "label": "API" },
    { "path": "/Users/me/work/mobile", "label": "Mobile App" }
  ],
  "summary": {
    "ai": false,
    "provider": "openai",
    "model": "gpt-5-mini"
  }
}

Notes:

  • The current cwd is always included implicitly.
  • Folder paths are resolved relative to the current cwd unless absolute.
  • AI summaries are opt-in with summary.ai: true and require a configured provider/model/API key.
  • If AI summary generation fails, the extension falls back to deterministic summaries.

Cache

AI summaries are cached in:

.pi/past-chats-cache.json

Cache entries are invalidated by session path, modified timestamp, summary version, provider, and model.

Install

pi install npm:@dreki-gg/pi-past-chats