btw-pi

Ask a context-free side question while Pi keeps working.

Packages

Package details

extension

Install btw-pi from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:btw-pi
Package
btw-pi
Version
0.4.0
Published
Jul 29, 2026
Downloads
155/mo · 79/wk
Author
egoryolkin
License
MIT
Types
extension
Size
12.6 KB
Dependencies
0 dependencies · 3 peers
Pi manifest JSON
{
  "extensions": [
    "./extensions/btw.ts"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

btw-pi

A lightweight Pi extension for asking an isolated side question while the main agent keeps working.

/btw what does SIGPIPE mean?

The answer appears as a compact card in the chat transcript. The card is a custom session entry, so neither the question nor the answer is added to the main model context. There is no centered modal: input stays in Pi's normal editor and an animated activity row remains visible above it.

UX

  • /btw <question> starts an independent completion with the currently selected model.
  • An animated /btw <question> activity row stays visible above the editor until the answer arrives.
  • If Pi is still streaming, the completed side answer is shown immediately in that row instead of waiting for the main transcript to settle.
  • Focus immediately returns to Pi's normal editor, so you can keep using the main conversation while /btw runs.
  • Side questions use minimal reasoning and a concise output budget for lower latency.
  • Pi's active inference continues; the side question is not queued as steer/follow-up.
  • /btw cancel cancels the active side question without aborting Pi's main inference.
  • One side request may run at a time.
  • Ctrl+O expands a result card to show model and timestamp.

Install

Install from npm:

pi install npm:btw-pi

Or try it for one run without installing:

pi -e npm:btw-pi

You can also install a local checkout while developing:

pi install /absolute/path/to/btw-pi

After changing a local extension, run /reload in Pi.

Design

  • Uses pi.registerCommand() rather than adding an LLM tool or system-prompt overhead.
  • Calls Pi's compatibility completeSimple() API with minimal reasoning and no shared conversation state.
  • Reuses Pi's selected model and credential registry.
  • Uses pi.appendEntry() plus registerEntryRenderer() for durable, display-only results.
  • Uses the injected theme and built-in TUI components.
  • Aborts in-flight work on session shutdown/reload.

Development

npm install
npm test
npm run pack:dry

Requires Node.js 20 or newer.

Release history is maintained in CHANGELOG.md.