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

@lanlance/pi-btw

v0.1.1

Published

Claude Code-style /btw side questions for pi: read-only sub-session answers in a floating overlay while the main agent keeps running

Downloads

287

Readme

/btw for pi — ask while it works.

License: Apache 2.0 CI TypeScript

中文说明

What Is This

The main agent is elbow-deep in a refactor, and a random question pops into your head — what was that config file called? Until now you either interrupted the run or opened another terminal.

/btw answers it in a floating overlay while the main agent keeps running:

/btw what was that config file called?
/btw what does this error actually mean?

Inspired by Claude Code's /btw, rebuilt natively for pi:

  • the answer streams into a top-center overlay; the main view keeps moving
  • never enters the main conversation or its context window
  • the side agent sees the main session's real messages, and remembers your earlier side questions — up to 20 exchanges
  • read-only tools (read / grep / find / ls): it can inspect the repo itself, but cannot touch anything
  • follow-ups typed straight into the overlay continue the same side thread

pi-btw in action

Install

pi install npm:@lanlance/pi-btw

or via git:

pi install git:https://github.com/L2ncE/pi-btw

or try without installing:

pi -e /path/to/pi-btw

Usage

Type /btw <question> at any time — including while the main agent is mid-task (pi runs extension commands immediately instead of queueing them).

Overlay keys:

| Key | Action | |---|---| | Enter | submit the follow-up in the input | | Esc | abort while answering; close when idle | | c | copy the current answer (raw markdown) to the clipboard | | / | page through this session's side Q&A history | | / | scroll a long answer | | Alt+/ | toggle focus between the overlay and the main editor (overlay stays visible; Ctrl+Alt+W as fallback) |

Earlier questions appear as a dimmed list above the current answer. The side thread lives in memory only — /new, restarts and reloads clear it, and none of it ever reaches the main conversation.

Design

  • one lazily-created in-memory AgentSession sub-session per pi session (SessionManager.inMemory(), nothing on disk), seeded by writing the main session's messages (buildSessionContext + convertToLlm) into the sub-session journal before creation — createAgentSession restores them through its own path, so they also survive compaction rebuilds
  • tool whitelist ["read", "grep", "find", "ls"] — no bash, no edit, no write
  • model and thinking level inherit the main session and re-sync before every ask
  • the system prompt is composed fresh by the sub-session from the main session's raw customPrompt and appendSystemPrompt (via getSystemPromptOptions()) plus the btw role prompt; context files and skills load from disk at first /btw, and the tools section lists exactly the four read-only tools
  • the system prompt tells the side agent exactly what it is: temporary, read-only, never promises actions

License

Apache-2.0