claude-code - 💡(How to fix) Fix [BUG] VS Code: abandoned chat panel creates stub session, "No conversation found" fires on every reload [1 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#54152Fetched 2026-04-29 06:34:51
View on GitHub
Comments
0
Participants
1
Timeline
5
Reactions
0
Participants
Timeline (top)
labeled ×5

Error Message

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

Root Cause

  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.

Code Example

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

---

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

---

{"type":"custom-title","sessionId":"aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa","customTitle":"<title>"}
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report
  • 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 [email protected]

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.

extent analysis

TL;DR

The issue can be fixed by modifying the Claude Code extension to not cache session IDs or write session metadata until the first user prompt is sent.

Guidance

  • To verify the issue, follow the steps to reproduce and check for the error toast on subsequent workspace reloads.
  • One possible fix is to modify the extension to detect and drop cached IDs whose backing .jsonl is turn-less on workspace load.
  • Another approach is to not write the custom-title event or cache the session ID until the first user prompt is sent.
  • To clean up, quit VS Code, delete the stub .jsonl file, and prune the orphan ID from the agentSessions.model.cache in state.vscdb.

Example

No code snippet is provided as the issue does not imply a specific code change.

Notes

The provided detection heuristic for stubs and orphans may be useful for the upstream fix. The issue may be specific to the Claude Code version 2.1.121 and the Anthropic API.

Recommendation

Apply a workaround by modifying the extension to not cache session IDs or write session metadata until the first user prompt is sent, as this approach directly addresses the root cause of the issue.

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