@fitchmultz/pi-stash
A pi extension for stashing draft messages and restoring them later.
Package details
Install @fitchmultz/pi-stash from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@fitchmultz/pi-stash- Package
@fitchmultz/pi-stash- Version
0.1.18- Published
- Jun 15, 2026
- Downloads
- 1,232/mo · 44/wk
- Author
- fitchmultz
- License
- MIT
- Types
- extension
- Size
- 27 KB
- Dependencies
- 0 dependencies · 2 peers
Pi manifest JSON
{
"extensions": [
"./extensions/stash.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
pi-stash
pi-stash is a pi extension for parking an in-progress draft, sending something else, then restoring the draft afterward.
Requirements
pirunning on Node.js>=22.19.0; Pi0.78.1or newer is the current tested baseline- npm for local validation and publishing
Install
From npm:
pi install npm:@fitchmultz/pi-stash
From GitHub:
pi install https://github.com/fitchmultz/pi-stash
For local development:
npm install
pi install .
Then run /reload inside pi.
Compatibility note: this package is tested against the current pi release during each package update, and pi-bundled runtime packages are declared as optional wildcard peers. Pi 0.78.1 is the current tested floor, not a hard npm peer requirement. That keeps installs forward-open for future pi releases: npm peer ranges should not block users from trying a newer pi, though runtime behavior is only verified against the tested baseline until a follow-up package release confirms it.
Development and validation
pi loads the extension from the source .ts files, but local tests are transpiled into .tmp/test-dist/ before Node runs them so validation works on the declared Node 22.19 floor.
npm run ci # typecheck + transpiled tests
npm run test:node22 # explicit Node 22.19 compatibility check
npm run validate # ci + Node 22.19 check + audit + pack dry-run
Design
Ctrl+Shift+Sstashes the current editor text and clears the editor.Ctrl+Shift+Rrestores immediately when there is one stash, or opens a picker when there are multiple stashes.- The stash picker supports arrow-key navigation,
Enterto restore,Ctrl+Dto delete the selected stash, andCtrl+Xto clear all stashes. - In non-TUI clients such as RPC, restore falls back to a replace-editor confirmation for the latest stash, and
/stash-listprints a latest-first summary instead of trying to open the TUI picker. - Restores use
pasteToEditor()when the editor already has text, so retrieval does not destroy whatever is currently in the box. - Drafts are kept as a small LIFO stack, so repeated stashes still work naturally.
- The current stash stack is persisted in session metadata, so
/reload, session resume, and/treebranch navigation keep drafts aligned with the active branch. - A footer status shows how many drafts are currently stashed.
Commands
/stash— stash the current editor text/stash some text— stash explicit text exactly as provided, including leading or trailing whitespace/stash-list— browse, restore, delete, or clear stashes
Why Ctrl+Shift+R for retrieval?
Ctrl+Shift+S appears free in the current pi keybinding docs, and Ctrl+Shift+R is also currently unassigned and mnemonic for restore.
Usage flow
- Start typing a draft.
- Press
Ctrl+Shift+S. - Type and send the interrupting message.
- Press
Ctrl+Shift+R. - If needed, pick a different stash with the arrow keys or delete one with
Ctrl+D. - Keep going with the restored draft.