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-session-memory

v0.6.1

Published

Local-first cross-session transcript search and native Pi session migration for Pi, Claude Code, and Codex

Downloads

1,548

Readme

pi-session-memory

Install

pi install npm:pi-session-memory

A local-first Pi extension for on-demand cross-session transcript search across Pi, Claude Code, and Codex, plus native project-session migration to Pi /resume sessions.

What it does

  • Indexes local Pi, Claude Code, and Codex JSONL transcript turns in local SQLite.
  • Provides recall_memory for literal raw-history search that returns every match.
  • Provides fetch_session for read-only expansion of the smallest useful transcript range.
  • Synchronizes changed history at Pi session start; /memory-backfill performs an explicit full rescan.
  • Migrates current-project Claude Code or Codex sessions into separate native Pi sessions.
  • Matches equivalent Windows project CWDs during migration, including \\ versus /, drive-letter case, and trailing separators.

Search results are derived from stored source transcripts only and are never automatically injected into model context. Put project rules and preferences in AGENTS.md.

Commands

| Command | Description | | --- | --- | | /pi-session-memory-helper | Show cross-session search and migration help. | | /memory-status | Show locally indexed session and turn totals. | | /memory-search <query> | Search locally indexed raw transcript history. | | /memory-backfill | Explicitly rescan historical Pi, Claude Code, and Codex JSONL. | | /project-session-migration | Convert current-project Codex sessions for /resume. | | /project-claude-session-migration | Convert current-project Claude Code sessions for /resume. |

Agent tools

| Tool | Use when | | --- | --- | | recall_memory | The user explicitly asks about a prior discussion, or agrees to history search. Use 2–8 specific literal entities. | | fetch_session | A recall excerpt lacks needed context. Fetch the smallest useful range. It is read-only. | | get_memory_stats | The user asks how much local history is indexed. | | backfill_memory | The user explicitly asks to import, backfill, or rescan history. | | migrate_codex_project_sessions | The user wants to continue current-project Codex work through /resume. | | migrate_claude_project_sessions | The user wants to continue current-project Claude Code work through /resume. |

Flow

session_start -> syncChangedHistory() -> SQLite raw transcript index
recall_memory -> matching raw transcript turns -> fetch_session (optional, read-only)
project migration command/tool -> native Pi session JSONL -> /resume

History remains on the local machine, by default in ~/.pi/agent/memory.db. Deleting that database removes only the index; restarting Pi rebuilds it from local source JSONL files.

Migration compatibility

Migration selects sessions whose recorded project CWD is equivalent to the current Pi project CWD. On Windows, C:\\Work\\app\\, C:/Work/app, and differences only in path letter case are treated as the same project. Migrated sessions are written using the current Pi project CWD, so they appear under that project in /resume.

Development

npm test          # core database, raw recall, importer, and migration regression suite