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

@ssweens/pi-handoff

v1.3.0

Published

Enhanced handoff extension for pi - context management for agentic coding workflows

Readme

pi-handoff

pi-handoff command

pi install @ssweens/pi-handoff

Context handoff extension for pi. Transfer context to a new session with a structured summary — three entry points, one UX.

Features

  • /handoff <goal> — User-initiated context transfer to a focused new session
  • Agent-callable tool — The model can initiate handoffs when explicitly asked
  • Auto-handoff on compaction — Offered as an alternative when context gets full
  • Parent session querysession_query tool for looking up details from prior sessions
  • Programmatic file tracking — Read/modified files extracted from tool calls (same as pi's compaction)
  • Structured format — Aligned with pi's compaction format (Goal, Constraints, Progress, Key Decisions, Next Steps, Critical Context)
  • System prompt hints — The model knows about handoffs and suggests them proactively

Installation

pi install @ssweens/pi-handoff

Usage

/handoff <goal>

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

What happens:

  1. LLM generates a structured handoff prompt from your conversation
  2. New session opens
  3. Prompt appears in the editor for review
  4. Press Enter to send — agent starts working

Agent-Initiated Handoff

Ask the model directly:

"Please hand this off to a new session"

The agent calls the handoff tool. Session switch is deferred until the current turn completes, then the same flow: new session → prompt in editor → press Enter.

Auto-Handoff on Compaction

When context gets full and auto-compaction triggers, you're offered a choice:

Context is 92% full. What would you like to do?
> Handoff to new session
  Compact context
  Continue without either

Select "Handoff" → same flow: LLM generates prompt → new session → prompt in editor → press Enter. If you cancel or it fails, compaction proceeds as normal.

Querying Parent Sessions

Handoff prompts include a parent session reference:

/skill:pi-session-query

**Parent session:** `/path/to/old-session.jsonl`

## Goal
...

The session_query tool lets the model look up details from the parent session without loading the full conversation:

session_query("/path/to/session.jsonl", "What files were modified?")
session_query("/path/to/session.jsonl", "What approach was chosen?")

Handoff Format

Aligned with pi's compaction format, with programmatic file tracking appended:

## Goal
What the user wants to accomplish.

## Constraints & Preferences
- Requirements or preferences stated

## Progress
### Done
- [x] Completed work

### In Progress
- [ ] Current work

### Blocked
- Open issues

## Key Decisions
- **Decision**: Rationale (path/to/file.ts:42)

## Next Steps
1. What should happen next

## Critical Context
- Data or references needed to continue

<read-files>
src/config.ts
</read-files>

<modified-files>
src/handler.ts
src/auth.ts
</modified-files>

Components

| Component | Type | Description | |-----------|------|-------------| | handoff.ts | Extension | /handoff command, handoff tool, compact hook, system prompt hints | | session-query.ts | Extension | session_query tool for querying parent sessions | | pi-session-query/ | Skill | Instructions for using session_query |

Architecture

Three entry points, one outcome:

| Entry Point | Context Type | Session Creation | |-------------|-------------|-----------------| | /handoff command | ExtensionCommandContext | ctx.newSession() (full reset) | | handoff tool | ExtensionContext | Deferred to agent_end via raw sessionManager.newSession() | | Compact hook | ExtensionContext | Raw sessionManager.newSession() (no agent loop running) |

All three end the same way: prompt in editor of new session → user presses Enter → agent starts.

License

MIT