@henryqw/pi-herdr-btw
Open and merge tool-enabled Pi side threads in Herdr panes.
Package details
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.2- Published
- Sep 6, 2026
- Downloads
- 2,114/mo · 1,575/wk
- Author
- henrywang
- License
- MIT
- Types
- extension
- Size
- 91.2 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.
Works with
| Package | Why |
|---|---|
@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, andhelproute only when they are exact first words. Other input is a question.- A provided question is an editable draft by default.
/btwsnapshots Main's compaction-aware context and inherits its working directory.- The consumer-owned
pi-herdr-btw/btwtask defaults tofast. - 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
- 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 mergeopens 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
{
"autoSubmit": false,
"tools": "inherit",
"split": "right"
}
| Field | Required | Possible values | Default |
|---|---|---|---|
autoSubmit |
No | true, false — submit the draft question automatically instead of leaving it editable in the side pane |
false |
tools |
No | inherit (parent's active tools), all, read-only (built-in read-only tools), none |
inherit |
split |
No | right, down — side-pane placement |
right |
- All fields are optional.
- Unknown keys and non-object files are rejected.
/btw config showprints effective values./btw config resetsaves the defaults.- The config file is optional. Missing config uses defaults.
- Malformed config fails visibly and remains unchanged.
Data, cost, and privacy
The side pane gets static parent context and shares Main's working directory. Enabled tools can change parent-visible files.
Launch data stays in a private temporary directory.
Limits and recovery
Large parent contexts can exceed child context limits.