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-kit/rewind

v0.1.0

Published

Claude Code-style rewind of code and conversation for the Pi coding agent. No third-party runtime dependencies.

Readme

@pi-kit/rewind

Rewind code and conversation to an earlier prompt in the Pi coding agent. Records file bytes around Pi's built-in write and edit tools and restores them when you revisit a point in the session. No configuration and no third-party runtime dependencies.

pi install npm:@pi-kit/rewind

Use /rewind to choose a user prompt on the current branch, newest first. It opens Pi's tree navigation and puts the selected prompt back in the editor. Wait for the response to finish before using /rewind.

Use /tree (or Pi's double Escape on an empty prompt) to select any point in the session. After Pi's summary choice, if code differs from that point, rewind offers:

| Choice | Effect | |---|---| | Restore code and conversation | Move the conversation, then restore code once the move succeeds | | Restore conversation only | Move the conversation and keep current files | | Restore code only | Restore files and stay at the current conversation point | | Cancel / Escape | Keep both code and conversation |

Use /fork (or double Escape when Pi's doubleEscapeAction is "fork") to branch the conversation. If code differs, choose Restore code, Keep current code, or Cancel. Restore code applies before the fork; if the fork itself then fails, the files have already been restored. A fork with code changes waits for an idle agent: rewind cancels it during an active response so an in-flight edit cannot overwrite the restore.

In the terminal UI, pressing Escape twice within 500 ms while idle clears a non-empty prompt. The second press is consumed; a third press does not open the tree. Empty prompts pass through to Pi. Clearing does not add the text to input history, so it cannot be recalled from history. Pi clears its Bash mode (! prefix) with a single Escape.

Files changed outside the recorded tool calls require one overwrite confirmation listing all conflicts. Declining keeps those files. Restores preserve existing file modes and use a temporary file plus rename; newly created files are removed when rewinding before their creation. Directories remain. Each restore reports restored files and any skipped paths.

Limits

  • Only built-in write and edit calls are captured. Bash changes, custom tools, and subagent edits are not tracked; this extension has no subagent integration.
  • Symlinks and files with more than one hard link are skipped on restore.
  • A missing snapshot or filesystem error skips that path and reports the reason. Capture failures let the tool run and warn once per path per session.
  • Menus require a UI. Headless runs still capture edits, but do not offer restores.
  • Records survive session resume and include abandoned branches within the same session. A forked session contains only its forked branch, so it cannot see records on the parent session's abandoned branches.
  • After restoring code only or keeping code while moving the conversation, a later restore can ask about conflicts caused by rewind itself.
  • Pi's /tree does nothing when selecting the current leaf, so it cannot offer a restore there. Use /rewind to revisit the current prompt.
  • Selecting an internal rewind record in /tree's all filter can expose an intermediate state from parallel edits; select a prompt for a stable point.

Snapshots

Snapshots live in <agentDir>/pi-kit-rewind/blobs, named by SHA-256 of their bytes. The directory is created with mode 0700, blobs with mode 0600. Reusing a blob refreshes its timestamp. On session start a best-effort sweep removes blobs older than 30 days. Restoring a swept blob skips the file and reports snapshot missing. There is no retention setting.

Node 22.19 or newer. Pi supplies the coding-agent and terminal-UI peers.

MIT