pi-stash is a pi extension for parking an in-progress draft, sending something else, then restoring the draft afterward.
pirunning on Node.js>=20.6.0- npm for local validation and publishing
From npm:
pi install npm:@fitchmultz/pi-stashFrom GitHub:
pi install https://github.com/fitchmultz/pi-stashFor local development:
npm install
pi install .Then run /reload inside pi.
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 20.6 floor.
npm run ci # typecheck + transpiled tests
npm run test:node20 # explicit Node 20.6 compatibility check
npm run validate # ci + Node 20.6 check + audit + pack dry-runCtrl+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. - When custom TUI overlays are unavailable (for example some RPC clients), restore falls back to a replace-editor confirmation for the latest stash, and
/stash-listprints a latest-first summary instead of crashing. - 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.
/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
Ctrl+Shift+S appears free in the current pi keybinding docs, and Ctrl+Shift+R is also currently unassigned and mnemonic for restore.
- 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.