[QOL FEATURE] Persistent prompt stash / library with /stash command & chat:stashPrompt keybind
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
Heavy Claude Code users build up reusable prompt patterns during sessions, but there's no way to capture and store them in-flow without leaving the terminal. The closest workaround is custom commands in .claude/commands/, but those require manually creating .md files outside the session. There's no way to save a prompt you just typed (or already sent) without context-switching to a file manager.
Proposed Solution
Core:
- New chat:stashPrompt keybinding action that saves the current input buffer to a persistent store
- New /stash slash command to list, browse, and re-insert saved prompts
- Storage at ~/.claude/stash.json or similar
- Stash persists across sessions and never auto-clears
Example keybindings.json:
{
"context": "Chat",
"bindings": {
"ctrl+s": "chat:stashPrompt"
}
}
Stash from history:
Not just the current input buffer... but the ability to stash a prompt you already sent. /stash last or a turn picker for recent user messages. The best prompts often reveal themselves after you see the output, not before.
Variable placeholders:
Stashed prompts support $1, $2 interpolation (same syntax as custom commands). Turns stashes into reusable templates without creating .md files:
"Refactor $1 to use the $2 pattern, preserving all existing tests."
Project-level stash:
A .claude/stash/ directory that gets committed to git, so team members share prompt patterns. Separate from personal ~/.claude/stash.json. Same relationship as .claude/commands/ (project) vs ~/.claude/commands/ (personal).
Fuzzy search:
The /stash picker should support fuzzy search. Once you have 20+ prompts, a flat list doesn't scale.
Import / export:
claude stash export and claude stash import CLI subcommands for sharing across machines or onboarding teammates.
Alternative Solutions
- Custom commands in .claude/commands/ DOES TECHNICALLY WORK for pre-authored prompts, but requires leaving the terminal to create .md files. No way to capture a prompt in-flow.
- External clipboard managers (e.g. Raycast) capture everything you copy, but has no awareness of Claude Code context. No tagging, no fuzzy search scoped to prompts, no $1/$2 interpolation, no project-level sharing via git. Also doesn't integrate with Zed's terminal workflow.
- Manually maintaining a prompts.md file and copy-pasting in/out DOES TECHNICALLY WORK but is entirely manual, no integration with the Claude Code workflow, and no keybind to make it seamless.
- Shell history (up arrow) only works within the same session, doesn't persist, and mixes prompts with every other command.
Priority
High - Significant impact on productivity
Feature Category
Interactive mode (TUI)
Use Case Example
You're deep in a session and craft a prompt that nails a specific refactor pattern. Right now it's gone once you send it, and you can scroll back and copy it, but there's no first-class way to bookmark it. With this feature:
- Type or refine a prompt in the input buffer
- Ctrl+S = saved to stash
- Next week, different project, run /stash, fuzzy search "refactor", re-insert it
- Or: after getting a great result, /stash last to save the prompt that produced it
For teams: commit .claude/stash/ to git and everyone shares battle-tested prompt patterns.
Additional Context
This would turn Claude Code from a conversation tool into a prompt workbench, think of it like git stash vs committed code.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗