[BUG] VS Code: abandoned chat panel creates stub session, "No conversation found" fires on every reload

Resolved 💬 2 comments Opened Apr 28, 2026 by Hulkster1004-1004 Closed Jun 12, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report
  • [x] I am using the latest version of Claude Code

What's Wrong?

When the Claude Code chat panel is opened in VS Code and the workspace is closed or reloaded before any prompt is sent, the extension leaves a stub .jsonl on disk (containing only a custom-title event, no user/assistant turns) and caches the session ID in the workspace's agentSessions.model.cache (inside state.vscdb).

On every subsequent workspace reload, the extension attempts to materialize the cached session. The CLI's resume path treats turn-less files as "not a conversation" and rejects them, producing:

Error: Claude Code returned an error result: No conversation found with session ID: <uuid>

The error fires once per cached orphan entry, per reload. On a single user/single machine on 2026-04-27 this fired 51 times across 7 window reloads before being noticed. The cached entry is workspace-scoped (in the workspace's state.vscdb), so the error follows the workspace forever once seeded.

What Should Happen?

Any one of these would fix it:

  1. Don't write the custom-title event (or any session metadata) until the first user prompt is sent.
  2. Don't cache the session ID in agentSessions.model.cache until the session has at least one turn.
  3. On workspace load, detect cached IDs whose backing .jsonl is turn-less, drop them from the cache, and don't retry.

Error Messages/Logs

Error: Claude Code returned an error result: No conversation found with session ID: aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa

The on-disk stub for the failing ID is just one line:

{"type":"custom-title","sessionId":"aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa","customTitle":"<title>"}

Total file size on disk: ~130 bytes.

Steps to Reproduce

  1. Open a VS Code window on any workspace.
  2. Open the Claude Code chat panel from the sidebar.
  3. Do not send a prompt. Close the workspace or reload the window (Cmd+R on macOS).
  4. Reopen the workspace. The error toast appears.
  5. Reload the window again. The error fires again. It will fire on every subsequent reload because the session ID stays cached in agentSessions.model.cache.

To clean up:

  • Quit VS Code (the SQLite cache is locked while VS Code is running).
  • Delete the stub .jsonl from ~/.claude/projects/<project>/<id>.jsonl.
  • Open ~/Library/Application Support/Code/User/workspaceStorage/<workspace>/state.vscdb and prune the orphan ID from the JSON value of agentSessions.model.cache (back up first).

Audit data (single user, single machine, 2026-04-27)

  • 5 Claude Code projects scanned via ~/.claude/projects/*/.
  • 2 stub .jsonl files found, both in the same project, created within ~25 minutes.
  • 51 error toasts fired across ~7 window reloads.

Is this a regression?

I don't know

Claude Code Version

2.1.121 (Claude Code), VS Code extension anthropic.claude-code@2.1.121

Platform

Anthropic API

Operating System

macOS 15.7.4 (Sequoia, Darwin 24.6.0)

Terminal/Shell

VS Code integrated terminal

Additional Information

The detection heuristic that worked reliably for me locally (in case it helps the upstream fix):

  • Stub on disk: .jsonl size < 8KB AND body does not contain "type":"user" or "type":"assistant".
  • Orphan in cache: any session ID matching claude-code:/[uuid] in the JSON value of agentSessions.model.cache whose corresponding .jsonl is missing or stub-only.

Cleanup requires VS Code to be quit (the cache SQLite is locked otherwise) and a backup of state.vscdb before pruning.

Happy to share test fixtures or detection logic if useful.

View original on GitHub ↗

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