prompt-shelf
v0.2.0
Published
Stash multiple prompts for later in Claude Code and Codex CLI: Ctrl+F to park a draft, Ctrl+Q to bring it back. Persistent, per repo.
Maintainers
Readme
prompt-shelf
Stash multiple prompts for later in Claude Code and Codex CLI. You're
halfway through a prompt and something else needs saying first: a quick
question, a new idea, or Claude is heading the wrong way and needs steering.
Press Ctrl+F to put the draft on the shelf, say what matters now, and press
Ctrl+Q to bring the draft back when you're ready. Keep as many drafts on
the shelf as you like, and they survive closing the session.
Install
Homebrew (macOS):
brew install sourabhshegane/tap/prompt-shelf
stash enableOne-line installer (uses npm under the hood):
curl -fsSL https://raw.githubusercontent.com/sourabhshegane/prompt-shelf/main/install.sh | shnpm, with -g (not the npm i prompt-shelf shown on the npm page, which
only adds it to the current folder):
npm i -g prompt-shelf && stash enableThen open a new terminal tab and run claude or codex as usual.
Ctrl+F stashes a draft, Ctrl+Q brings it back. stash doctor checks the
setup: it should say on PATH: yes and claude: shim installed.

Why not Claude Code's Ctrl+S?
| | Claude Ctrl+S | prompt-shelf |
| --- | --- | --- |
| Drafts it holds | 1 | as many as you want |
| Survives closing the session | no | yes |
| Shared across repos | no | yes, filtered to the current repo by default |
| Search | no | yes (/ in the list) |
The same keys work in Codex CLI too, and both agents share one shelf.
What install changes
stash enable puts a small claude / codex shim in ~/.prompt-shelf/bin/
and adds that folder to the front of your PATH with one marked line in your
shell rc file (~/.zshrc, ~/.bashrc or ~/.config/fish/config.fish).
Running it again is harmless. All of the agent's own arguments still work,
e.g. claude --resume. Requires Node 20 or newer (Homebrew installs it for
you).
Keys
While you're typing in Claude Code or Codex:
| Key | What it does |
| --- | --- |
| Ctrl+F | Stash what's in the box and clear it |
| Ctrl+Q | Open the stash list. Whatever you've typed stays in the box |
In the list:
| Key | What it does |
| --- | --- |
| ↑ ↓ or j k | Move |
| Enter | Unstash: add the entry to the box (on a new line after your text) and remove it from the stash |
| a | Same, but keep it in the stash |
| d then y | Delete the entry |
| r | On a shelf: rename it (its prompts move with it) |
| D then y | On a shelf: delete it and the prompts on it |
| / | Search; Esc clears it |
| Tab | Switch between this repo's entries and all of them |
| Esc, q, Ctrl+C, Ctrl+F or Ctrl+Q | Close the list |
Pasted a long block that shows up as [Pasted text #1 +12 lines] (Claude) or
[Pasted Content 1500 chars] (Codex)? Ctrl+F still saves the full text, not
the placeholder.
prompt-shelf takes over Ctrl+F and Ctrl+Q while the agent runs. In Claude
Code Ctrl+F normally moves the cursor right one character (the arrow key
does the same). Pick other keys with stash hotkey if you use them.
When the agent starts, a dim line above the input box says prompt-shelf is on, shows both keys, and how many drafts are parked in this repo. It fades after a few seconds.
For a reminder that stays, Claude Code can show prompt-shelf in its status line
(⌁ prompt-shelf · 2 parked · ctrl+f to stash · ctrl+q to unstash; without the count when nothing is parked). Add this to
~/.claude/settings.json:
"statusLine": { "type": "command", "command": "stash statusline" }It prints nothing when Claude Code runs without prompt-shelf, and it replaces any status line you already have.
Both keys can be changed, to ctrl+<letter> or f1–f12:
stash hotkey f2 # stash key
stash hotkey list f3 # list key
stash hotkey # show bothCommands
| Command | What it does |
| --- | --- |
| stash list [--all] | Print this repo's entries (--all: every repo) |
| stash add <text> | Stash text from the command line |
| stash pop [n] [--all] | Print entry n (1 = newest) and remove it |
| stash rm <n> [--all] | Remove entry n |
| stash hotkey [list] [key] | Show or change the hotkeys |
| stash doctor | Check the shims, PATH and where the real agents live |
| stash enable / stash disable | Add or remove the shims and the PATH line |
| stash claude / stash codex | Run an agent through the wrapper explicitly |
| STASH_OFF=1 claude | Run the real agent without the wrapper |
Troubleshooting
| What you see | Fix |
| --- | --- |
| Ctrl+F does nothing | You're in a tab or an agent session that was open before you installed. Open a new tab and start claude again. |
| stash: command not found | It was installed without -g. Run npm i -g prompt-shelf (and npm rm prompt-shelf in the folder where you ran it without -g), or use Homebrew. |
| Installed with Homebrew but Ctrl+F does nothing | Run stash enable once, then open a new tab. |
| stash doctor says on PATH: no | Add the line it prints to your shell rc file and open a new tab. |
| stash doctor says claude: shim missing | Claude Code wasn't on your PATH when you installed. Run stash enable. |
| Your terminal already uses Ctrl+F or Ctrl+Q | Pick other keys: stash hotkey f2, stash hotkey list f3. |
| You want the agent without prompt-shelf, once | STASH_OFF=1 claude |
Uninstall
stash disable # removes the shims and the PATH line
brew uninstall prompt-shelf # if you used Homebrew
npm rm -g prompt-shelf # if you used npmSkipping stash disable is fine: the shims fall through to the real
claude / codex when stash is gone.
Supported
| | Last tested with (macOS) | | --- | --- | | Claude Code | 2.1.284 | | Codex CLI | 0.157.1 |
CI runs typecheck, tests and build on Node 20, 22 and 24 (macOS) for every
push and pull request to main.
How it works
claude resolves to a shim that runs stash claude. prompt-shelf starts the
real claude in a pseudo-terminal and passes your keystrokes and its output
straight through, so the agent behaves exactly as it would on its own. On the
side it keeps a copy of the screen, and a small per-agent adapter reads the
input box from it when you press Ctrl+F. Unstashing pastes the text back in
as a normal paste. Nothing is ever sent to the agent for you.
Entries live in ~/.prompt-shelf/stash.jsonl and settings in
~/.prompt-shelf/config.json.
Caveats
- If an agent changes how its input box looks,
Ctrl+Fmay stop reading it. When that happens it says "nothing to stash" and never clears anything it couldn't read. - Long lines the agent wraps on screen are joined back with a space. In a very narrow terminal a wrap can occasionally come back as a line break.
- On a Mac keyboard the F-keys are media keys by default, so an
f2hotkey means pressingFn+F2.
Roadmap and contributing
See ROADMAP.md for what's next (a prompt library with groups, more agents) and CONTRIBUTING.md to help out.
License
MIT
