Add a prompt stash / temporary prompt buffer keyboard-shortcut

Resolved 💬 3 comments Opened Jun 18, 2026 by hvanmegen Closed Jun 22, 2026

What variant of Codex are you using?

CLI

What feature would you like to see?

I would like Codex CLI to have a prompt stash feature similar to Claude Code's Ctrl+S prompt stash behavior.

Use case:

While writing a longer prompt, I sometimes realize there is another smaller or more urgent task I want to do first. Right now, I either have to delete/copy the current prompt manually, paste it somewhere else, or risk losing it.

Requested behavior:
  • Press a keyboard shortcut while editing a prompt (for example Ctrl+S)
  • Codex stashes the current prompt into a temporary buffer
  • The TUI shows a '< stashed' string in the bottom right corner, just above the chat bar.
  • The input area is cleared so I can write and submit another prompt
  • Pressing the shortcut again restores the stashed prompt and removes the TUI string.
  • Ideally this works without leaving the Codex CLI session
  • Ideally it should preserve multiline prompts exactly as written

This would make it much easier to interrupt my own prompt-writing flow without losing partially written work. It would also save me from having to use the mouse to copy what I have written, which usually not even works if it's longer than the terminal width or contains pasted data.

Additional information

A few terminal-specific caveats would be worth considering:

  • Ctrl+S may already be used by some terminals for software flow control (XOFF), so the shortcut should preferably be configurable.
  • If Ctrl+S is used as the default, Codex should document what to do when the terminal captures it instead of passing it through.
  • Copying partially written prompts out of a terminal is unreliable when the input wraps across lines, exceeds the terminal width, or contains pasted multiline data.
  • The stash should be in-memory and session-local by default, since prompts may contain sensitive code, paths, logs, or credentials.
  • If a prompt is already stashed and the current input is not empty, Codex should avoid silently overwriting either value. A small warning stating to confirm by pressing CTRL-S again (but only after a certain timeout, like with CTRL-D) or swap behavior would be safer.
  • The visible TUI indicator such as < stashed would help make it clear that there is currently a saved prompt waiting to be restored.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗