[BUG] VSCode sidebar "Past conversations" empty - extension filters out its own sessions via includeProgrammaticSessions=false (regression in 2.1.191)
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?
The "Past conversations" sidebar panel in the VSCode extension is empty - it shows no previous sessions despite having 87 session transcript .jsonl files on disk under ~/.claude/projects/.
Root cause: In v2.1.191, the VSCode extension host class (Ks) sets includeProgrammaticSessions = false, which filters out sessions with entrypoints in the set ["sdk-cli", "sdk-ts", "sdk-py"]. However, all sessions created from the VSCode extension itself are tagged with "entrypoint": "sdk-cli" in their transcript files. The extension is filtering out its own sessions.
The filtering logic in DAe() checks the head/tail of each .jsonl file for the entrypoint field, and when includeProgrammaticSessions is false, any session matching those entrypoints is excluded from the listing. Since the VSCode extension spawns Claude via the SDK (entrypoint: "sdk-cli"), every session it creates gets hidden.
Relevant code path in extension.js:
Ks(VSCode host class) overridesincludeProgrammaticSessions = !1listSessions()passesincludeProgrammatic: this.includeProgrammaticSessionsto the session listing functionKY()callsif (!t && DAe(r.head, r.tail)) return null- filtering out sdk-cli sessionsNAe = new Set(["sdk-cli", "sdk-ts", "sdk-py"])defines what counts as "programmatic"
What Should Happen?
Sessions created from the VSCode extension should appear in the "Past conversations" sidebar. The programmatic session filter should not apply to sessions that were created by the extension itself, or includeProgrammaticSessions should be true in the VSCode host class.
Error Messages/Logs
No error messages - the panel renders successfully but shows zero sessions.
Steps to Reproduce
- Install Claude Code VSCode extension v2.1.191 or later (tested on v2.1.193)
- Open a workspace and have one or more conversations via the sidebar
- Close the conversation and look at the "Past conversations" panel
- The panel is empty despite session
.jsonlfiles existing on disk
To verify:
- Check
~/.claude/projects/<project-dir>/-.jsonlfiles are present - Inspect the first user message in any
.jsonlfile - it contains"entrypoint":"sdk-cli" - In
extension.js, theKsclass setsincludeProgrammaticSessions=!1, which filters these out
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.1.190 - this version does not have the includeProgrammatic filtering concept at all. The filter was introduced in 2.1.191.
Claude Code Version
Extension: 2.1.193 CLI (via declawd): 2.1.157
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
VS Code integrated terminal
Additional Information
The includeProgrammaticSessions property exists in two classes:
UU(base class): sets it totrue(correct for non-IDE contexts)Ks(VSCode extension host, extendsUU): overrides it tofalse
The intent appears to be hiding sessions created by external SDK consumers (scripts using Claude programmatically). But the VSCode extension itself uses the SDK transport and tags sessions as sdk-cli, so they get caught by the same filter.
Version comparison:
- v2.1.190: 0 occurrences of
includeProgrammaticin extension.js - v2.1.191: 5 occurrences, with
Ksclass setting it tofalse - v2.1.193: same behavior as 2.1.191
Possible fixes:
- Set
includeProgrammaticSessions = trueinKs(simplest) - Tag VSCode-originated sessions with a distinct entrypoint (e.g.
"claude-vscode") and only filtersdk-cliwhen used outside IDE context - Add a user-facing setting to control whether programmatic sessions are shown
4 Comments
Can corroborate the root cause from the transcript side. Inspecting my own on-disk sessions under
~/.claude/projects/:So
sdk-cliis not an "SDK script only" marker — it's stamped on real, resumable interactive transcripts that live right next to thecliones. That lines up exactly with your trace: ifincludeProgrammaticSessions = falsedrops everything whose entrypoint is in["sdk-cli", "sdk-ts", "sdk-py"], it throws out legitimate interactive history, not just programmatic SDK runs. The bug is the conflation ofentrypoint == sdk-cliwith "programmatic / non-interactive."Two things that may help others landing here:
.jsonltranscripts are all still on disk under~/.claude/projects/<encoded-cwd>/, so nothing was deleted by the 2.1.191 update.claude --resume) in the same project directory — the resume picker reads those transcripts directly rather than going through the extension-sideincludeProgrammaticSessionsfilter, so the "missing" VSCode sessions are still reachable there.For the maintainers: the fix probably shouldn't key the interactive/programmatic distinction off
entrypointat all, sincesdk-clinow covers interactive extension sessions too. A dedicated flag (e.g.isInteractive/ a realheadlessmarker written into the transcript) would separate "spawned by an SDK script" from "interactive session that happens to be launched via the sdk-cli entrypoint" without false-filtering user history.The 87 transcript files are still on disk, but the extension's
includeProgrammaticSessions=falsesetting treats thesdk-climarker as a reason to hide them. The result is a session-list filter problem, not evidence that those transcripts were deleted.I built
BasedGPT/claude-code-session-recoveryfor related VS Code session-list failures. Runpython tools/diagnose.pyfirst and follow the exact command it prints. If it reports dropped VS Code entries,recover_vscode_sessions.pyreads complete JSONL files and rebuilds the cache instead of relying on the extension's head/tail scan. Keep VS Code closed before applying a cache repair.The
sdk-clievidence also points to the upstream distinction that matters: the extension is writing a resumable interactive session with that marker, so it isn't a reliable synonym for an external SDK script.Hope this helps, if my tools are able to help you, would appreciate a ⭐ :)
Still present in 2.1.226 (win32-x64, Windows 11) — the stale label looks premature. Same defect, but it now presents differently: the entrypoint written is sdk-ts rather than sdk-cli, the VS Code host class is now _o extends zB, and the symptom is partial rather than total. CLI sessions list fine; Agent-window sessions vanish the moment they are closed.
That partial form is more confusing than the original empty list — a session is visible while live, disappears on close, and claude --resume still lists it, so it reads as data loss.
Repro:
claude --resume still lists it; the transcript is intact in ~/.claude/projects/<project>/.
grep '"entrypoint"' <transcript>.jsonl → sdk-ts.
Seven interactive sessions from one day were hidden this way here. Nothing was lost, but the sidebar and CLI disagreeing makes it look like it.
Workaround: rewrite "entrypoint":"sdk-ts" → "cli" in affected transcripts (durable), and/or flip includeProgrammaticSessions=!1 to !0 in extension.js (reverted by each update). Preserve file mtime — the sidebar sorts on it.
Hey upt75, those seven Agent-window sessions are still on disk; it is the VS Code session list hiding them, not transcript loss.
The newer
sdk-tsmarker looks like the same filter family as the earliersdk-clicase.claude --resumeproving the sessions are reachable is the useful split: the CLI can enumerate the transcript files while the extension drops them after close.I built
BasedGPT/claude-code-session-recoveryfor related VS Code session list failures. Runpython tools/diagnose.pyfirst and follow the exact command it prints. If it reports dropped VS Code entries, run the printed dry-run forrecover_vscode_sessions.py; keep VS Code closed before applying a cache repair. I would preserve the transcript files and avoid rewritingentrypointby hand until the upstream filter is fixed, because an extension update can put the filter back.Hope this helps, if my tools are able to help you, would appreciate a ⭐ :)