[FEATURE] Make the Ctrl+S prompt stash a LIFO stack (git-stash-style push/pop) instead of a single slot

Status Open
Maintainer reply None cached
Activity 0 comments · opened Jul 19, 2026

Summary

Make the prompt stash (chat:stash, bound to Ctrl+S by default) a LIFO stack instead of a single slot: pushing when the input is non-empty, popping the most recent entry when it is empty.

Current behavior

Per the interactive-mode and keybindings docs, chat:stash is a single-slot toggle:

  • Input non-empty + Ctrl+S → stash the draft (text, cursor position, pasted content) and clear the input.
  • Input empty + Ctrl+S → restore the stashed draft.

If a second draft is stashed before the first is restored, the first is silently overwritten and lost.

Proposed behavior

Keep the exact same conditional dispatch, but back it with a stack:

  • Input non-empty + Ctrl+S → push the draft onto the stash stack and clear the input.
  • Input empty + Ctrl+S → pop the most recent draft off the stack into the input.

With at most one stashed draft, this is behaviorally identical to today — the change is purely additive and fully backwards compatible. No new keybinding, action name, or configuration is needed (though a small stash-depth indicator in the UI, similar to the queued-messages count, would be a nice complement).

Motivation

  • It matches the mental model the feature already borrows. "Stash" strongly evokes git stash, which has been push/pop since its inception. Users coming from git (i.e., nearly all Claude Code users) expect stash to be a stack; the single-slot overwrite is the surprising behavior, and it discards user-typed content silently.
  • The interactive flow regularly needs depth > 1. A common sequence: mid-draft, a permission prompt or notification arrives → stash → start typing a quick corrective instruction → realize something else must be answered first → stash again. That second stash currently destroys the first draft with no warning.
  • Silent loss of the stash is already a reported pain point. #75663 documents the stashed prompt being silently dropped in the agent switcher. A stack does not fix that bug, but both point at the same underlying issue: stashed drafts are user data and deserve durability guarantees. (See also #74513 on the feature's discoverability.)

Alternatives considered

  • Custom keybinding/config: not possible — ~/.claude/keybindings.json can only map keys onto the fixed action vocabulary; there is no way to compose or redefine action behavior, and no separate pop/cycle action exists.
  • Prompt history (Up / Ctrl+R): only covers submitted prompts, not unsubmitted drafts.
  • External editor (Ctrl+G): works, but is a heavyweight escape hatch for what Ctrl+S almost already does.

Environment

  • Claude Code CLI, Linux (Fedora 44), interactive terminal mode
  • Behavior confirmed against current published docs (interactive-mode and keybindings pages) as of 2026-07-19

View original on GitHub ↗