JohnsonRan/pi-btw

★ 0Forks 0TypeScriptGitHub ↗Compare

README

pi-btw

Claude Code-style /btw side questions for the Pi coding agent.

Ask a quick question about the current session while the main agent keeps working. The side request sees a compaction-aware snapshot of the conversation and has no tools. It stays outside the main conversation unless you explicitly promote an answer.

Install

Install directly from GitHub:

pi install git:github.com/JohnsonRan/pi-btw

To pin a release or commit, append a Git ref:

pi install git:github.com/JohnsonRan/[email protected]

From a local checkout:

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

Run /reload after installing into an existing Pi session.

Usage

/btw which config file are we editing?
/btw explain that error in one sentence
/btw why did we choose this approach?

Run /btw without a question to reopen the latest answer. In the answer overlay, press P to promote the selected question and answer into the main conversation context without interrupting the active task.

Behavior

  • Executes immediately, including while the main agent is streaming.
  • Calls the active model independently with low reasoning effort and no tools.
  • Uses the current compaction-aware session context as a read-only snapshot.
  • Keeps side questions and answers out of the main transcript and LLM context by default.
  • Promotes the selected side discussion to the main context with P; promoted answers are marked as unverified and do not trigger a new turn.
  • Shows answers in a dismissible overlay.
  • Keeps up to 20 answers in memory for the current extension load.
  • Supports Up/Down scrolling and Left/Right history navigation.
  • Cancels the side request with Esc while the loading overlay is open.

Differences from Claude Code

Pi extensions cannot reuse the main provider request's prompt cache. A /btw request therefore has separate input-token cost, especially in long sessions. Side-answer history is in memory and resets when Pi reloads or changes sessions.

Development

npm is used only for development dependencies and validation; this project is distributed as a Git-based Pi package and is not published to npm.

npm install
npm run check

Try the package without installing it:

pi -e .

Security

Pi extensions run with the current user's full system permissions. Review extension source before installing third-party packages. This extension does not execute shell commands or register tools, but it sends the current conversation snapshot to the selected model provider.

License

MIT

Contributors

JohnsonRan

Issues