[BUG] VS Code: Input text lost when switching between chats or restarting extension

Open 💬 0 comments Opened Jun 17, 2026 by jwbth

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?

When using Claude Code in the VSCode extension, if you type text in the input field but don't send it, then switch to a new chat and come back — the typed text is gone. There is no draft saving or persistence of unsent input across chat switches. The same when restarting the extension or VS Code itself.

This is frustrating when composing longer prompts or when accidentally switching chats. Users lose their work-in-progress input with no way to recover it.

What Should Happen?

The unsent input text should be preserved when switching between chats (tabs/conversations) and restored when returning to the original chat. This is standard behavior in most chat applications (Slack, Telegram, Discord, etc.). The same with restarting the extension.

Steps to Reproduce

  1. Open Claude Code panel in VSCode
  2. Start typing a message in the input field (do not send)
  3. Switch to a new chat / conversation
  4. Switch back to the original chat
  5. Result: The input field is empty — typed text is lost

Alternatively:

  1. Run command "Restart Extension Host" in VS Code (or restart VS Code itself)
  2. Result: The input field is empty — typed text is lost

Claude Model

None

Is this a regression?

No, this never worked

Last Working Version

_No response_

Claude Code Version

2.1.178 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Other

Additional Information

This is a repost of #34596 with modifications (restarting the extension is now mentioned as well). The original issue was closed due to inactivity (despite 4 👍) — hopefully it'll get more attention this time. This was also reported in #61515.

The Cmd+N shortcut conflict makes this issue even worse — it's easy to accidentally trigger a session switch without realizing it, and the loss is silent.

Fix suggestion: store per-session draft input in VSCode extension state (context.workspaceState or globalState) and restore it when the user returns to a session.

View original on GitHub ↗