[BUG]

Status Open
Reported on v2.1.282
Maintainer reply None cached
Activity 0 comments · opened Oct 1, 2026

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 VS Code starts, the Claude panel opens an empty "Untitled" conversation and spawns a Claude process for it. When I then open my saved conversation from the session list, a second process is spawned with --resume, but the first, empty one is never stopped. It keeps running in the background for as long as VS Code is open: one extra process per workspace window, on every start.

The empty session doesn't appear in the session history, so it can't be closed from the UI. When such a session does show up in history, its menu offers only Rename and Archive, and Archive doesn't stop the process. Only kill <pid> helps.

This matters because the background process is a full session: it registers for cross-session messaging and executes messages from other sessions. Other sessions see two sessions for the same project, and a message sent to both is executed by both. In my case two agents started working on the same file in parallel, and since the empty session is invisible in the UI, I couldn't see what it was doing.

For comparison, Claude Code desktop connected to the same host over SSH doesn't have this problem: one process per session, and Archive stops it.

What Should Happen?

One Claude process per workspace: the conversation I actually opened.

The empty conversation the panel shows at startup should either not spawn a process until I type something, or its process should be stopped as soon as I switch to another session. Any session process that keeps running should be visible in the session list and closable from the UI.

Error Messages/Logs

No error messages. Extension log (exthost*/Anthropic.claude-code/Claude VSCode.log), IDs and paths redacted:

07:45:15.216 webview: update_panel_host_session {"kind":"restore_declined","sessionId":"<id>"}
07:45:16.480 webview: launch_claude {"cwd":"<path>","freshStartIfUnresumable":false,...}   <- no "resume"
07:45:17.063 Spawning Claude with SDK query function ... resume: undefined
07:45:36.641 webview: get_session_request {"sessionId":"<id>","purpose":"transcript_open"}   <- I pick the saved session
07:45:37.075 webview: launch_claude {"cwd":"<path>","resume":"<id>",...}
07:45:37.225 Spawning Claude with SDK query function ... resume: <id>

The process spawned at 07:45:17 is never stopped. Its ~/.claude/sessions/<pid>.json exists, but there is no transcript file for its sessionId. Running processes afterwards (same workspace):

  <pid A>   claude ... (no --resume)        <- empty session, still alive
  <pid B>   claude ... --resume=<id>        <- the session I opened

Same sequence on every start: observed on three different days, in 2-3 workspaces each time.

Steps to Reproduce

  1. Connect VS Code to a Linux host with Remote-SSH and open a workspace that has a saved Claude conversation.
  2. Quit VS Code completely and start it again; reopen the workspace.
  3. The Claude panel shows an empty conversation. Don't type anything in it.
  4. Open the saved conversation from the session list.
  5. On the remote host, list the Claude processes:

pgrep -af native-binary/claude
Two processes are running for the workspace: one with --resume=<id> (the opened conversation) and one without --resume (the empty one from step 3).

  1. The empty one never exits while VS Code is open. It isn't shown in the session list and can't be closed from the UI.

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

Unknown. Already present in early September 2026; confirmed on 2.1.282 through 2.1.286.

Claude Code Version

VS Code extension 2.1.286 (spawned CLI 2.1.285); also observed on 2.1.282 and 2.1.283

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

VS Code integrated terminal

Additional Information

  • The panel sends "restore_declined" for the previous conversation on every start; the log doesn't show why. Restoring it directly instead of opening an empty conversation would avoid the extra process altogether.
  • Each workspace window gets its own extra process, so with 2-3 windows open there are 2-3 hidden sessions.
  • The leftover process can be identified reliably: no --resume on its command line, and no transcript file for the sessionId in ~/.claude/sessions/<pid>.json.
  • Possible workaround (untested): claudeCode.useTerminal = true, which avoids the native panel.

View original on GitHub ↗