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

@nicknisi/pi-handoff

v0.1.7

Published

Compact the session into a handoff document for another agent

Downloads

1,394

Readme

@nicknisi/pi-handoff

Transfer context from the current session to a new, focused session. Instead of compacting the conversation (lossy), /handoff <goal> sends the serialized conversation plus your stated goal to the current model, which generates a self-contained prompt summarizing relevant decisions, findings, and files. You review/edit the generated prompt in an editor overlay, then the extension creates a new session (linked to the current one via parentSession) and pre-fills the editor with the prompt for submission. The generated prompt also appends a session-history chain so the new session can recover full context via pi --session <path> if needed.

What it adds

  • Slash command: /handoff <goal for new thread>
  • UI: a BorderedLoader overlay while the prompt generates (abortable), and a full-screen editor overlay (Edit handoff prompt) for reviewing/editing the result
  • No tools, keybindings, widgets, events, or custom entry types

Usage

/handoff now implement this for teams as well
/handoff execute phase one of the plan
/handoff check other places that need this fix

Flow:

  1. Collects all messages on the current session branch via ctx.sessionManager.getBranch().
  2. Serializes them with convertToLlm + serializeConversation.
  3. Walks the parentSession chain (reading the first line of each parent session file with head -1) to build a session-history list.
  4. Streams a request to the current model with a fixed system prompt ("context transfer assistant") and a user message containing the conversation history and your goal.
  5. Appends a ## Session History section listing session files, most recent first.
  6. Opens the result in the editor overlay; on confirm, calls ctx.newSession({ parentSession }) and sets the edited prompt as the editor draft with ctx.ui.setEditorText. You submit it yourself.

Aborting the loader or closing the editor without confirming cancels with a notification; no new session is created.

Configuration

None. No config files, no options, no environment variables. Uses whatever model and credentials are currently selected in pi.

Dependencies

  • @earendil-works/pi-coding-agent (peer): ExtensionAPI, SessionEntry types; BorderedLoader, convertToLlm, serializeConversation runtime imports.
  • @earendil-works/pi-ai (peer): Message type; provider streaming via the model registry.
  • @nicknisi/pi-shared (workspace): getModelProvider(ctx, model) — resolves the composed runtime provider from ctx.modelRegistry, honoring models.json overrides and extension-registered providers.

Auth is resolved per-call via ctx.modelRegistry.getApiKeyAndHeaders(ctx.model); a missing API key aborts with an error notification.

Caveats

  • Requires interactive mode (ctx.hasUI); does nothing useful headless.
  • Depends on pi internals that may change across versions:
    • ctx.sessionManager.getBranch(), getSessionFile(), getHeader() and the parentSession header field.
    • Session files being JSONL with the header as the first line (parsed via head -1 <file> through pi.exec).
    • ctx.newSession({ parentSession }), ctx.ui.custom, ctx.ui.editor, ctx.ui.setEditorText.
    • BorderedLoader, convertToLlm, serializeConversation exports from the main package (not a compat path).
  • The parent-chain walk shells out with head -1; malformed or missing parent files silently terminate the chain.
  • Generation uses the currently selected model, so handoff quality/cost tracks whatever model you have active.

Install

pi install /Users/nicknisi/Developer/pi-extensions/packages/handoff