[BUG] Stashed prompt (Ctrl+S) is silently lost when a background agent goes cold (warm → resume) in the agent switcher

Open 💬 0 comments Opened Jul 8, 2026 by mimkorn

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

A prompt stashed with Ctrl+S is silently lost when the agent it belongs to transitions from warm (running in the background, immediately switchable — shown with a filled/"star" icon in the agent switcher) to cold (suspended/killed, must be resumed — shown with a "dot" icon).

The stash lives only in memory. When the agent-view lifecycle drops the agent from warm to cold, there is no persistence of the stashed draft, so switching back into the agent (which now requires a resume) comes up with an empty prompt input. The stashed text is gone with no warning and no way to recover it.

This makes the stash feature unreliable for anyone who works across multiple background agents: you can't trust that a parked prompt will still be there when you come back to that agent, because whether it survives depends on whether the agent happened to stay warm in the meantime.

This is the same root cause described in the (now closed/stale) #26615 "Improve stash reliability" — the stash is never written to disk — but surfaced by a specific, reproducible lifecycle event rather than by a crash/500. It is also analogous to #47267 (compaction overwriting the stash): a lifecycle transition destroying the parked prompt.

What Should Happen?

The stashed prompt should survive the warm→cold→resume lifecycle. Concretely, the stash should be persisted (e.g. to the session's on-disk state) so that:

  1. Switching into a cold agent and resuming it restores the previously stashed prompt.
  2. The stash is never silently discarded as a side effect of an agent being suspended/backgrounded/killed.

Ideally the stash would be persisted to disk generally (as #26615 requested), which would fix this case and the crash/500 case together.

Error Messages/Logs

_No error is shown — the loss is silent._

Steps to Reproduce

  1. In an agent that is running in the background, type some text into the prompt input and press Ctrl+S to stash it. Confirm the input clears and the text is stashed.
  2. Let that agent go cold — i.e. leave it until the agent switcher shows it with the "dot" (suspended / needs-resume) icon instead of the "star" (warm / active) icon.
  3. Switch back into that agent and resume it.
  4. Expected: the stashed prompt is restored. Actual: the prompt input is empty; the stash is gone with no warning and no recovery.

Claude Model

Opus

Is this a regression?

Unknown — the stash has never been persisted to disk (see #26615), so this may have never worked across a resume.

Last Working Version

_No response_

Claude Code Version

2.1.204

Platform

Anthropic API

Operating System

macOS 26.5.1

Terminal/Shell

fish

Additional Information

Related: #26615 (stash not persisted to disk — closed as stale), #47267 (compaction overwrites/unstashes the prompt — closed as stale), #50758 (stash should be a stack, not a single slot). The agent-view side has separate reports of work lost on suspend/resume (e.g. #63023) but none tie it to the prompt stash.

View original on GitHub ↗