Session History panel fails to list/resume local sessions
## Description The Session History panel in the VS Code extension does not list or let me resume past local sessions, even though the session transcripts exist and are intact on disk. Related keybinding/command issues found during troubleshooting are included below.
Steps to Reproduce
- Have one or more prior Claude Code sessions saved locally (
~/.claude/projects/<project>/*.jsonlpresent and readable). - Click the history/clock icon in the Claude Code panel.
- Separately, try Command Palette > search "Resume Session" and try the matches shown (
Claude Code: Reopen Closed Session[Ctrl+Shift+T],Ask in Chat: Claude Code: Resume Session[Ctrl+Alt+I]).
Expected Behavior
The history icon should show a searchable list of past sessions for the current project. "Reopen Closed Session" should reopen a recently closed Claude Code session. The resume keybinding should resume a Claude Code session, not launch GitHub Copilot Chat.
Actual Behavior
- History icon: only the currently-open session is shown, or a blank "Untitled" session opens if none is open. Typing into the search field returns no results even for titles known to exist on disk. If a session is already open, pressing the icon hides its visible chat content (title stays, messages disappear from view — the underlying data isn't deleted).
- "Reopen Closed Session" (
Ctrl+Shift+T): does nothing when invoked. - "Ask in Chat: Claude Code: Resume Session" (
Ctrl+Alt+I): opens a new GitHub Copilot Chat session instead of resuming Claude Code — looks like a keybinding collision where Copilot interceptsCtrl+Alt+I.
Diagnostic detail from the extension's own log (Claude VSCode.log): clicking history fires a list_sessions_request (entryPoint sessions_dialog) plus a separate list_remote_sessions call. The remote call correctly logs Fetched 0 remote sessions (expected, local-only usage). The local list_sessions_request never logs a result count or error at all — it silently returns nothing despite valid .jsonl session files on disk.
Workaround: running claude --resume from an interactive terminal in the project directory correctly lists and resumes sessions, since it reads the same .jsonl files directly — unaffected by whatever's failing in the panel's request path.
Environment
- Extension: Claude Code for VS Code, v2.1.246
- OS: Windows 11
- A stale duplicate v2.1.245 install was found and removed during troubleshooting; issue persisted after removal, so it isn't a duplicate-version artifact.
Additional context
Diagnosed collaboratively with Claude (Claude Code) while troubleshooting session resume across multiple attempts (history icon, command palette, keybindings) before concluding the panel itself is broken rather than user error.
I have the same issue .. While the Local Session View is rendered I find this error when a symbol is attempted to be rendered .. Could be related..
Loading the font 'data:font/ttf;base64,AAEAAAALAIAAAwAwR1NVQiCLJXoAAAE4AAAAVE9TLzI3T0tHAAABjAAAAGBjbWFwQ5s/ewAACSQAABreZ2x5ZvJtKHkAACekAAD3FGhlYWRYl6BTAAAA4AAAADZoaGVhAlsC+QAAALwAAAAkaG10eBxB//oAAAHsAAAHOGxvY2EFi8dWAAAkBAAAA55tYXhwAu8BgQAAARgAAAAgbmFtZZP3uUsAAR64AAAB+HBvc3RjGEbCAAEgsAAAGSQAAQAAASwAAAAAASz////+AS4AAQAAAAAAAAAAAAAAAAAAAc4AAQAAAAEAAFT7+XFfDzz1AAsBLAAAAAB8JbCAAAAAAHwlsID////9AS4BLQAAAAgAAgAAAAAAAAABAAABzgF1ABcAAAAAAAIAAAAKAAoAAAD/AAAAAAAAAAEAAAAKADAAPgACREZMVAAObGF0bgAaAAQAAAAAAAAAAQAAAAQAAAAAAAAAAQAAAAFsaWdhAA...h0C3RyaWFuZ2xlLXVwB3R3aXR0ZXISdHlwZS1oaWVyYXJjaHktc3ViFHR5cGUtaGllcmFyY2h5LXN1cGVyDnR5cGUtaGllcmFyY2h5BnVuZm9sZBN1bmdyb3VwLWJ5LXJlZi10eXBlBnVubG9jawZ1bm11dGUKdW52ZXJpZmllZA52YXJpYWJsZS1ncm91cA92ZXJpZmllZC1maWxsZWQIdmVyaWZpZWQIdmVyc2lvbnMJdm0tYWN0aXZlCnZtLWNvbm5lY3QKdm0tb3V0bGluZQp2bS1ydW5uaW5nAnZtAnZyD3ZzY29kZS1pbnNpZGVycwZ2c2NvZGUEd2FuZAd3YXJuaW5nBXdhdGNoCndoaXRlc3BhY2UKd2hvbGUtd29yZAZ3aW5kb3cJd29yZC13cmFwEXdvcmtzcGFjZS10cnVzdGVkEXdvcmtzcGFjZS11bmtub3duE3dvcmtzcGFjZS11bnRydXN0ZWQHem9vbS1pbgh6b29tLW91dAAA' violates the following Content Security Policy directive: "font-src 'self' https://*.vscode-cdn.net". The action has been blocked.
The strongest signal here is that claude --resume still lists the sessions while the VS Code local request returns no result. That points to the extension's session-list and cache layer; the JSONL transcript files are intact. The Ctrl+Alt+I collision is a separate keybinding problem, so I would keep it separate from the missing local entries.
I built BasedGPT/claude-code-session-recovery for this file-layer split. From that checkout, run python tools/diagnose.py first and follow the exact command it prints. It checks the transcript files and will identify the VS Code session-list route when the on-disk sessions are present but the extension cache has dropped their entries.
Keep a copy of the affected ~/.claude/projects/ directory and the VS Code workspace state before applying anything. Close VS Code before running a command with --apply, review the dry-run output first, and compare one session that claude --resume can see with the entries returned by the panel. That will confirm whether the missing layer is the extension cache rather than the transcript.
Hope this helps, if my tools are able to help you, would appreciate a ⭐ :)
@andyandyau Found the root cause for this — it's a CSP misconfiguration, not a rendering bug.
The webview's Content-Security-Policy is built in extension.js (the Local Session View webview) from a few template strings:
style-src ${$.cspSource} 'unsafe-inline'`, q=`font-src ${$.cspSource}`, N=`img-src ${$.cspSource} data:`, O=`worker-src ${$.cspSource}`
img-src explicitly whitelists the data: scheme so inline base64 images work, but font-src never does. The Local Session View renders an icon font as a data:font/ttf;base64,... URI, which the CSP then blocks — exactly the console error you posted.
Local workaround until this is fixed upstream:
In your installed extension folder (<user>/.vscode/extensions/anthropic.claude-code-<version>-win32-x64/extension.js), find the line containing font-src ${$.cspSource} and change it to:
font-src ${$.cspSource} data:
(mirrors what img-src already does). Then run "Developer: Reload Window" from the Command Palette — a plain file save doesn't reload the cached extension host JS.
Confirmed this clears the CSP violation and the symbols render correctly.
⚠️ Caveat: this edits a shipped, minified extension file directly, so it is not persistent — it'll be silently overwritten the next time the extension auto-updates. If the font error comes back after an update, that's why: just reapply the same one-line data: addition to font-src until the maintainers ship the real fix (adding data: to font-src in the webview CSP builder, same as img-src).
@BasedGPT flagging this suggestion for anyone else landing on this thread.
I reviewed the linked claude-code-session-recovery repo (cloned locally, read-only, nothing installed or executed) before considering the recovery steps suggested above. For transparency:
- Static review found no network calls, no
eval/exec, no obfuscated payloads, and no credential harvesting intools/. Thesubprocesscalls are static argument lists to local tools (git,vssadmin,wmic,tasklist,powershell), not shell-interpolated, so no obvious injection vector. - That said, it's a brand-new, low-star repo (created ~3 months ago) that showed up as an unsolicited self-promotion in someone else's bug thread, ending with a request for a star — not how genuine troubleshooting help usually arrives. It also ships an
AGENTS.md/CLAUDE.mdexplicitly addressed to "any AI assistant helping a user with this repo," which is a notable design choice for a tool whose "mutator" scripts perform real deletions/rewrites (os.remove,shutil.rmtree, metadata rewrites) against a user's actual Claude Desktop/CLI session data.
Nothing here proves bad intent, and today's snapshot reads clean, but I'd caution against running --apply mutations against real session data based on an unaudited, unfamiliar repo promoted this way — especially since it's unrelated to the actual bug in this issue (a CSP font-src misconfiguration, see the comment above). Worth keeping this thread focused on the extension bug itself.
Update: found and confirmed the root cause of the local-session-listing failure (separate from the font-src CSP issue discussed above).
Root cause: in extension.js, the workspace directory is resolved through fs.promises.realpath() (helper referred to below as xp()) before being used to compute which local ~/.claude/projects/<encoded-path> folder to scan for session files. For a normal local path this is a no-op. For a workspace on a mapped network drive (e.g. a drive letter created via net use, not subst), realpath() resolves the drive letter through to its UNC target — a different string than the literal drive-letter path that the session-storage folder name is actually derived from. The lookup then scans the wrong (often nonexistent) directory, a bare catch{} a few calls down swallows the resulting error silently, and the panel just renders as if there were zero sessions — matching the "never logs a result count or error at all" behavior in the original report exactly.
This single divergence caused three symptoms that looked separate but shared one cause:
- History panel showing only the current/blank session (list-building function, internally calls
_N(<resolved-path>, ...)) - Clicking a past session failing to load its transcript (separate function used to locate a specific session's
.jsonlfile, samexp()call feeding it the wrong directory) - The currently-open chat visually clearing when History was clicked (appears to be a downstream rendering effect of the failed lookup above, not an independent bug)
Confirmed locally: reproduced by running fs.promises.realpath() directly against the mapped drive letter and watching it resolve to the UNC path; then patched the two call sites in the installed extension (v2.1.251, code shape unchanged in v2.1.252) to use the original, un-resolved workspace path instead of the realpath()-resolved one for the actual directory scan, while leaving the resolved path in place everywhere else (e.g. worktree cross-referencing, where resolving symlinks may be intentional). After patching + "Developer: Reload Window", all three symptoms resolved: session list populates, past sessions load correctly, and the visual-clear issue stopped.
Not a fix for the source (this was a live patch against the shipped, minified extension.js — non-persistent, gets wiped on the next auto-update), but should be a precise enough pointer for whoever has the actual source: the fix is to stop resolving the workspace path through realpath() before using it as the session-storage lookup key (or make sure whatever writes session files under that key applies the exact same resolution), specifically in the local session-list and session-open code paths.
Happy to share the exact patched code/diff if useful — the affected functions are easy to spot by searching for the realpath call site whose result feeds a session-directory scan.
Update: the bug recurred after an extension auto-update (v2.1.252 → v2.1.259), triggered right after a VS Code editor update — worth flagging since it confirms this isn't a one-time fix, it's a moving target across builds.
What changed between builds: the two call sites patched previously (session-list, session-open) had completely different minified names in v2.1.259, as expected for a re-minified bundle — an idempotent local patch script correctly detected this and skipped them rather than silently doing nothing wrong.
New finding — the same divergence exists at more than one layer, and different builds route through different subsets of it: v2.1.259 turned out to have consolidated workspace-path resolution to a single origin point (a panel-controller class's constructor, instantiated at 3 call sites, all wrapping the workspace path in realpathSync). Patching just that origin point looked complete — syntactically valid, no errors, clean logs — but the bug still reproduced. Tracing further showed the actual session-list and session-open functions each make their own separate internal realpath() call on the (already-clean) path, one layer deeper — structurally the same bug as before, just reintroduced downstream. Both layers needed patching.
Practical implication for anyone hitting this: a "the file is patched, syntax is valid, logs look clean" outcome is not proof the fix worked — the local session-list path never logs a success/failure signal either way. The only real test is actually clicking History and looking at the panel. And if a future update breaks it again, the fix needs to be re-derived, not just reapplied — the specific pattern to look for: search near workspace.workspaceFolders/.fsPath for where the workspace path first gets touched, trace it to wherever it's stored as a cwd-like field on the panel/session-controller class, then don't stop there — trace into the actual directory-scan function for a second, independent realpath()-wrapping call one or two levels deeper.
Happy to share the current patch strings for v2.1.259 if useful, same caveat as before: this is a live edit to shipped, minified code, not a real fix — it'll be wiped by the next auto-update, and the underlying pattern (resolving a workspace path through realpath() before using it as a storage key, when the writer side doesn't) should really be fixed at the source so it stops recurring across every future re-minification.
Update: broke a third time after another extension auto-update (v2.1.259 → v2.1.261), just two days after the last comment here.
Same underlying divergence as before, but worth flagging a new detail this time: the "second layer" (the independent, redundant realpath() call that reintroduces the bug even after the obvious workspace-path resolution point is patched) wasn't in the same kind of function as last time. In v2.1.259 it lived directly inside the local session-list/session-open functions themselves. In v2.1.261 those functions were clean — the panel-controller's workspace-path resolution was the only place doing it at that layer — but a small shared helper sitting one level further downstream in the local session-listing call chain (invoked well after the panel's own cwd was already clean) was independently re-resolving that path through realpath() again before it gets used to compute the ~/.claude/projects/<encoded-path> lookup key.
So across three consecutive re-minifications, the fix keeps needing full re-derivation, and the specific place the "second layer" lives doesn't even stay consistent from build to build. That's a stronger signal than before that this is a structural issue — something resolving the workspace path through realpath() before using it as a storage/lookup key, in a codepath where the side that originally names those directories doesn't apply the same resolution — rather than something a one-off patch to any specific function will actually close for good.
Not proposing the exact source fix here since this is still just reverse-engineered from the shipped, minified bundle, not the actual source — just flagging that this keeps resurfacing on every update and the root cause is still live three builds later.
Update: recurred twice more since the last comment — v2.1.266 (2026-09-10, same shape as v2.1.261) and v2.1.267 (2026-09-11, i.e. after only a single patch-version bump). That's five recurrences in about ten days now, tracking the extension's own update cadence rather than any particular release cycle.
One small but telling detail from the v2.1.267 build: the three separate call sites that previously each inlined workspacePath[0] || homedir() wrapped in realpathSync(...) got consolidated into a single shared helper function. Functionally identical divergence, just refactored to one place instead of three. Worth noting because it shows the resolve-before-using-as-lookup-key pattern is a deliberate, maintained piece of the codebase (someone touched and cleaned up this exact code path across a rebuild) rather than an incidental one-off mistake nobody's looked at since — which makes it a more addressable fix at the source than "an old accidental bug nobody remembers," since the surrounding code is clearly still being actively worked on.
Still the same underlying issue as originally reported: the workspace path gets resolved through realpath() before being used to compute the ~/.claude/projects/<encoded-path> lookup key, which diverges from the raw path on a mapped network drive. No source-level fix yet as far as I can tell — happy to keep posting here as it keeps recurring, since the pattern itself hasn't changed in five rebuilds, just where in the bundle it lives.
Update: recurred again in v2.1.269 (2026-09-12), the sixth recurrence in about eleven days. Two details in this build worth flagging beyond "same bug, new names":
-
The local session-list logic is now duplicated in two separate places in the bundle, both independently exhibiting the same divergence. Previous builds had one code path for this; this one apparently has two (possibly two separate bundle chunks/entry points), and both needed the same fix applied independently.
-
The
realpath()call itself now lives in a shared, multi-purpose helper function that's also used by legitimate, unrelated call sites elsewhere in the extension (a settings-file resolver, at minimum). That means the actual fix can't be "striprealpath()out of that helper" — it has to target the specific thin wrapper that feeds the value into the session-list lookup key, leaving the shared helper's other callers untouched. This is probably the most useful detail for whoever ends up fixing this at the source: the bug isn't "there's a strayrealpath()call that shouldn't be there," it's "a value gets resolved through a general-purposerealpath()utility and then used as a storage/lookup key without the writer side applying the same resolution" — the utility itself is fine and needed elsewhere, only this one specific call site's use of its result is the problem.
Same root cause as always: workspace path resolved through realpath() before being used to compute the ~/.claude/projects/<encoded-path> key, diverging from the raw path on a mapped network drive. Still recurring on every rebuild, still no source-level fix as far as I can tell.
Closing for now — inactive for too long. Please open a new issue if this is still relevant.