@henryqw/pi-herdr-btw

Open and merge tool-enabled Pi side threads in Herdr panes.

Packages

Package details

extension

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

$ pi install npm:@henryqw/pi-herdr-btw
Package
@henryqw/pi-herdr-btw
Version
3.0.4
Published
Sep 10, 2026
Downloads
3,301/mo · 593/wk
Author
henrywang
License
MIT
Types
extension
Size
91.1 KB
Dependencies
3 dependencies · 2 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

@henryqw/pi-herdr-btw

Ask a focused side question in Herdr, then return its transcript and next instruction to Main. This avoids changing Main's conversation path or copying the result by hand.

Inspired by Claude Code and its /btw side-question mode. This package adds transcript merge back into Main.

Install

pi install npm:@henryqw/pi-task-models
pi install npm:@henryqw/pi-herdr-btw

Requires Herdr 0.7.4+ and a Herdr-managed pane. Run /task-models and configure the fast profile before opening a side thread. Open /task-models again and verify that fast no longer says not configured.

Works with

Package Relationship Purpose
@henryqw/pi-memory Improves Marks side-thread children, suppressing parent-only memory injection and dream advice.
@henryqw/pi-task-models Required Provides shared model profiles for side-thread routes.

Use

Run /btw Why is this test failing? and submit the draft in the side pane. After the answer, run /btw merge Apply the smallest safe fix there.

Main receives the side transcript, regains focus, and continues with the merge prompt.

/btw                              open an empty side pane
/btw <question...>                open side pane with draft question
/btw ask <question...>            escape reserved first words
/btw config [...]                 show or change launch defaults
/btw merge <prompt...>            merge side thread into Main and continue
/btw help                         show grammar

Use /btw to open a side thread, set its defaults, or recover a pending merge.

Flow

Launch

  • ask, config, merge, and help route only when they are exact first words. Other input is a question.
  • A provided question is an editable draft by default.
  • /btw gives the side pane a static snapshot of Main's compaction-aware context and shares Main's working directory.
  • The consumer-owned pi-herdr-btw/btw task defaults to fast.
  • Before pane launch, it selects the first authenticated viable effective profile route.

~/.pi/agent/config/pi-task-models/config.json is shared and owned by @henryqw/pi-task-models. A task entry is an explicit user override, and routes resolve before pane launch. BTW warns once per session if this file is missing.

Merge delivery

Sequence showing a fixed context snapshot with live shared files; the transcript and prompt queue until Main is idle and authenticated, then Main appends the transcript and submits the prompt.

  • In the side pane, /btw merge <prompt> stores the user/assistant transcript and next prompt as pending delivery.
  • Herdr then refocuses Main and closes the side pane.
  • Pending delivery survives side-pane shutdown. It waits for Main to settle and for current model authentication.
  • Main appends the transcript without starting a turn, then submits the prompt.
  • Bare /btw merge opens the prompt editor.
  • Pending delivery remains available until consumed or 24-hour stale cleanup.

Config

Package-owned: ~/.pi/agent/config/pi-herdr-btw/config.json

Name Description Values Default
autoSubmit Submits the draft question instead of leaving it editable in the side pane. Boolean. false
tools Selects the tools available in the side pane. inherit (parent's active tools), all, read-only (built-in read-only tools), or none. inherit
split Sets the side-pane placement. right or down. right
  • All fields are optional.
  • Unknown keys and non-object files are rejected.
  • /btw config show prints effective values.
  • /btw config reset saves the defaults.
  • The config file is optional. Missing config uses defaults.
  • Malformed config fails visibly and remains unchanged.

Limits and recovery

Enabled tools can change parent-visible files.

Large parent contexts can exceed child context limits.