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-edit-session-in-place

v0.1.14

Published

pi extension that lets you re-edit or delete an earlier user message in the current session branch

Readme

pi edit-session-in-place

A pi extension that lets you rewind to an earlier user message in the current branch, then either edit it in place or delete it and continue from there.

Compatibility

Tested with:

  • @earendil-works/pi-coding-agent 0.78.0
  • @earendil-works/pi-tui 0.78.0
  • Node.js >=22 <25

Local development and verification in this repo target pi 0.78.0. @earendil-works/pi-coding-agent and @earendil-works/pi-tui stay in devDependencies for local typechecking and tests, while pi core packages are declared as optional wildcard peers and the extension relies on pi's bundled runtime packages at execution time. That keeps installs forward-open for future pi releases: npm peer ranges should not block users from trying a newer pi, though runtime behavior is only verified against the tested baseline until a follow-up package release confirms it.

What it does

  • Adds /edit-turn
  • Adds a global hotkey: Ctrl+Shift+E
  • Lets you choose an earlier user message from the current branch
  • Rewinds pi to that point in the same session file
  • Loads your edited text back into the main editor
  • Treats an empty submit as delete this message and continue from here

Install

Install from npm with pi:

pi install npm:pi-edit-session-in-place

Or install directly from GitHub with pi:

pi install https://github.com/fitchmultz/pi-edit-session-in-place

Then reload pi from inside the app with:

/reload

Usage

Inside pi:

/edit-turn

Or press:

Ctrl+Shift+E

Message picker behavior

  • Shows earlier user messages from the current branch only
  • Uses a viewport so long threads stay navigable
  • Orders messages oldest → newest
  • Starts with the newest message selected at the bottom
  • moves to older messages, moves to newer ones
  • PageUp / PageDown jump faster

Editor behavior

  • Ctrl+X clears the entire selected message instantly
  • Enter submits the edited message
  • Shift+Enter inserts a newline
  • Escape cancels without changing history
  • Ctrl+G opens your external editor if $VISUAL or $EDITOR is set

If you clear the message and submit an empty value, the selected message is effectively deleted: pi rewinds to just before that message and leaves the main editor empty so you can type a new prompt.

Behavior notes

  • Works in interactive mode; non-interactive modes do not show the picker/editor UI
  • Later messages on the abandoned branch are not deleted from the session file; they remain reachable through /tree
  • If the selected message contains images, the extension warns that re-editing or deleting it will drop the images and keep only text behavior
  • The extension only offers text-bearing user messages for editing; image-only or whitespace-only user messages are skipped
  • Queued messages must be cleared before using the command

Development

For local development you can point pi at the extension directly:

pi -e ./extensions/edit-session-in-place.ts

Local verification:

npm run verify

That runs:

  • npm test — compiles the TypeScript test fixtures to .test-dist/ and runs them with Node's built-in test runner
  • npm run typecheck — strict TypeScript type-checking
  • npm pack --dry-run — publishability check for the npm package contents

Current regression coverage in tests/edit-session-in-place.test.ts includes:

  • message extraction from mixed session content
  • oldest-to-newest ordering for the picker
  • skipping image-only and whitespace-only user messages
  • preserving the image-warning flag for mixed text+image messages
  • $VISUAL/$EDITOR resolution rules
  • external editor command parsing with quoting/escaping
  • trimming exactly one trailing newline from external-editor output

Files

  • extensions/edit-session-in-place.ts — publishable extension implementation
  • tests/edit-session-in-place.test.ts — regression tests for message extraction, ordering, and external-editor helpers