[FEATURE] Copy or move the current prompt draft to a different session (stash is single-slot, same-session only)
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
I need to take the prompt I am typing in one Claude Code session and carry it to a different session. There is no way to do that today.
The prompt stash (chat:stash, Ctrl+S) does not cover this. Per the interactive-mode docs, Ctrl+S "stashes it and clears the prompt. Pressed again on an empty prompt, restores the stashed text, cursor position, and pasted content." The stash is a single slot that restores into the same session. It appears to live in process memory (#75663 reports the stash is lost when a background agent goes cold), so a second session cannot see it.
Typical trigger: I write a long prompt, then realize it belongs in another repo's session, or that this session's context is too far gone and I want to start fresh with the same prompt. The only path is to retype it or mouse-select it in the terminal. Mouse selection breaks on wrapped multiline input, and it likely copies the [Pasted text #N] placeholder instead of the pasted content.
Proposed Solution
Add a way to move the current draft prompt out of the session. Either of these would solve it:
- Copy the draft to the system clipboard. A new
Chataction, for examplechat:copyPrompt, that copies the full input buffer (including expanded pasted content) to the clipboard. I then paste it into any other session. This is the smallest change. - Make the stash cross-session. Have
chat:stashwrite the draft to a store on disk (for example under~/.claude/), so Ctrl+S on an empty prompt in a different session restores it. This keeps the existing Ctrl+S muscle memory and also fixes the loss reported in #75663.
The key requirement is that the text leaves the session intact, including cursor position and pasted blocks where possible.
Alternative Solutions
- Ctrl+S stash: single slot, same session only.
- Esc Esc saves the draft to history. Whether Ctrl+R in a second session can recall a draft saved this way is not documented; even if it can, that is a search for a discarded draft rather than a deliberate move.
- Terminal mouse selection: unreliable on wrapped and multiline input, and does not capture pasted content.
- Related requests: #79185 (make the stash a LIFO stack) and #30405 (persistent stash library, closed inactive). Both are about keeping more drafts; this request is about moving one draft to a different session.
Priority
High - Significant impact on productivity
Feature Category
Interactive mode (TUI)
Use Case Example
- I am in a session for repo A, halfway through a detailed prompt with a pasted stack trace.
- I realize the change belongs in repo B, which has its own session in another terminal.
- With this feature, I press one key to copy the draft (or stash it cross-session), switch to the repo B session, and paste or restore it.
- Today I retype the prompt or fight with mouse selection, and the pasted content is lost.
Claude Code version: 2.1.269, Linux.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗