claude-code - 💡(How to fix) Fix Ability of Claude-Code for draft text to persist when switching between chats [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#55578Fetched 2026-05-03 04:49:46
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Author
Timeline (top)
labeled ×3commented ×1

Fix Action

Fix / Workaround

Submitting a placeholder message (e.g., ... or hold) just to preserve context — but this pollutes the chat history and wastes a turn. Keeping a separate text editor or sticky note open as a scratch pad for in-progress prompts — works but adds friction and breaks focus. Copying the draft to clipboard before switching chats — easy to forget, and the clipboard only holds one thing at a time. Avoiding multitasking across chats entirely and finishing one prompt before switching — not always practical when the workflow genuinely requires context-switching. None of these are satisfying. They all require conscious extra effort to work around what should be automatic behavior. The core issue is that the workaround has to be remembered and executed before switching — but the need only becomes obvious after returning and finding the draft gone.

RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing requests and this feature hasn't been requested yet
  • This is a single feature request (not multiple features)

Problem Statement

When working across multiple chats simultaneously, I frequently switch between them to manage different tasks or contexts. If I've started typing a prompt in one chat and switch to another before submitting, the in-progress text is silently discarded. When I return to the original chat, my draft is gone with no warning or recovery option.

This happens in a natural multitasking workflow: start composing a prompt → realize I need to check or handle something in another chat → switch over → come back → draft is lost. The interruption itself is normal; losing the work is not.

The result is that I either have to submit incomplete prompts just to "save" them, keep a separate text editor open as a scratch pad, or re-type from memory — all of which break focus and add friction to an otherwise fast tool.

Proposed Solution

When I return to a chat where I had started typing but not submitted, my draft text should still be there — exactly as I left it. No extra UI, no buttons, no opt-in: just the input field retaining its content per-chat across navigation.

Ideally:

Each chat maintains its own independent draft state. The draft persists as long as the session is open (tab/window not closed). If the app is closed and reopened, restoring the draft would be a bonus but is not essential — session-level persistence is the minimum. No confirmation or save action required from me — it should be automatic and invisible. The interaction should feel identical to how browser address bars or most messaging apps (Slack, WhatsApp, Telegram) handle unsent text: you leave, you come back, it's still there.

Alternative Solutions

Alternatives considered:

Submitting a placeholder message (e.g., ... or hold) just to preserve context — but this pollutes the chat history and wastes a turn. Keeping a separate text editor or sticky note open as a scratch pad for in-progress prompts — works but adds friction and breaks focus. Copying the draft to clipboard before switching chats — easy to forget, and the clipboard only holds one thing at a time. Avoiding multitasking across chats entirely and finishing one prompt before switching — not always practical when the workflow genuinely requires context-switching. None of these are satisfying. They all require conscious extra effort to work around what should be automatic behavior. The core issue is that the workaround has to be remembered and executed before switching — but the need only becomes obvious after returning and finding the draft gone.

Priority

Medium - Would be very helpful

Feature Category

Interactive mode (TUI)

Use Case Example

No response

Additional Context

Similar features in other tools:

Slack — each channel/DM maintains its own unsent draft automatically; visible with a "Draft" label in the sidebar. Telegram / WhatsApp — switching between conversations always preserves unsent text in each chat's input field. Gmail — unsent replies are auto-saved as drafts per thread without any user action. These are all standard expectations for any multi-conversation interface.

Technical considerations:

Draft state only needs to be stored in memory (per session), not persisted to disk — keeping it lightweight and avoiding any privacy concerns around unsubmitted text. Each chat already has a unique ID/session handle, so keying draft state to that identifier should be straightforward. No new UI surface needed — the existing input field behavior is all that changes. Constraint worth noting:

This is specifically observed in the VS Code extension environment (Claude Code running inside VSCode on Windows 11). Behavior may differ in the CLI TUI or the web app — those haven't been tested for this specific issue.

<img width="1244" height="993" alt="Image" src="https://github.com/user-attachments/assets/aab97774-2274-4738-b6f5-80bbd5d66ba3" />

extent analysis

TL;DR

Implementing a feature to persist draft text per chat session can resolve the issue of lost drafts when switching between chats.

Guidance

  • Identify the unique identifier for each chat session to key the draft state, as mentioned, each chat already has a unique ID/session handle.
  • Store the draft state in memory per session to keep it lightweight and avoid privacy concerns, as the draft only needs to be stored for the duration of the session.
  • Modify the input field behavior to retain its content when switching between chats, ensuring that the draft text is preserved without requiring any user action.
  • Consider the constraint that this issue is specifically observed in the VS Code extension environment and may require adjustments for other environments like the CLI TUI or web app.

Example

No specific code example can be provided without knowing the exact implementation details, but the approach would involve using the chat's unique ID to store and retrieve the draft text from memory when the user switches between chats.

Notes

The solution should focus on session-level persistence, with the option to explore more permanent storage solutions if needed. The key is to ensure that the draft text is retained across chat switches without adding extra UI or requiring user confirmation.

Recommendation

Apply a workaround by modifying the existing input field behavior to retain draft text per chat session, as this directly addresses the user's need to preserve work when switching between chats.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING