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

@335g/pi-byetheway

v0.0.2

Published

Side conversation space (/btw) that reads the session context and never writes to it.

Readme

pi-byetheway

日本語

A side conversation space that reads the session context and never writes to it. Run /btw mid-session, ask about what you have done so far, and close it without leaving a trace in the session or in the agent's context. When you do want the conclusion to survive, ctrl+n reformats the exchange into one message and sends that to the main session.

Install

pi install npm:@335g/pi-byetheway

pi install writes to the user settings (~/.pi/agent/settings.json). Add -l to write to the project settings (.pi/settings.json) instead.

Usage

  • /btw — open the space

Keys:

| Key | Action | |-----|--------| | Enter | send the question | | Shift+Enter | newline | | Esc | stash the space and return to the main editor (state is kept) | | ctrl+d | close and discard (asks first when there is anything to lose) | | ctrl+n | hand the exchange to the main session (see below) | | ctrl+u, PageUp, PageDown, Up/Down on an empty input | scroll the history |

These keys only apply while the btw panel has focus. The hand-off key is ctrl+n rather than the more obvious ctrl+p because ctrl+p cycles the model in pi's main editor; pressing it there expecting a hand-off would silently switch the model. ctrl+n is unbound in the main editor, so a stray press does nothing.

While a question is in flight the answer streams in. You can keep typing; Enter is ignored until it finishes. A failed question is put back into the input so you do not retype it, and the reason (provider error, empty answer, interrupted) is shown in the body above the input, not only in the footer.

Handing the exchange to the session (ctrl+n)

The point of the space is that nothing leaks into the main session by accident, so the hand-off is explicit:

  1. ctrl+n asks for a focus.
  2. 1-4 insert a preset (Conclusion and evidence, Decision and reason, Open questions, Rejected options). You can edit the text or type any other focus instead. Empty means the default focus.
  3. Enter rewrites the whole exchange into one message and shows it.
  4. The preview is editable. Enter sends it as a user turn; Esc goes back; ctrl+r reformats.

5 skips the rewrite and previews the raw transcript, which is the escape hatch for when the rewrite misses. The rewrite prompt says: write in the first person, keep attribution for the other side's proposals ("an alternative was ..."), and output only the message body. Attribution matters — without it the main agent reads someone else's suggestion as your own decision.

What is and is not sent

  • Nothing is written to the session file. There are no appendEntry calls and no messages.
  • The main agent's context is untouched until you press Enter in the preview.
  • The btw request carries the messages the main agent would have sent (the session branch with compaction applied), plus the exchange so far. It carries no tool definitions, so the record is flattened to text: a tool result becomes [read の出力] ..., and a tool call inside a turn that also has prose becomes [read]. A turn that consists of nothing but tool calls is dropped, because keeping it would leave a [bash] line per call and read as an example of answering with a tool call. Images are replaced with (画像は省略). On a long session that turns ~250 messages into ~35 without losing any prose.
  • Because that prefix is identical to the main session's, providers with prefix caching usually charge the context at the cached rate. A long uncompacted session still means a large request per turn.

Limitations

  • The btw agent cannot read files or run commands; it only reasons over the session context. Read-only tools (read, grep, find, ls) are the planned next step.
  • Because the session transcript contains tool calls, a model can try to call a tool even though none are offered. The btw system prompt forbids that explicitly. When a reply comes back empty (the usual symptom of a refused tool call), the panel reports it as an error and puts the question back in the input.
  • The context is a snapshot taken when /btw opens. Work done in the main session after that is not included. Reopening the space after a stash keeps the same snapshot.
  • A stashed space is dropped when the session is replaced.

Development

node packages/pi-byetheway/selfcheck.ts

Runs both self-checks: the context projection (tool-call and tool-result flattening, image dropping, same-role merging, assistant metadata preservation) and the pi-facing surface (registered command/ shortcut/event, and that the private ModelRuntime.stream keeps its receiver).