VS Code extension: session tabs restore empty despite correct CLAUDE_CONFIG_DIR and intact .jsonl files (related to #45424)
Description
Session tabs in the VS Code extension restore with the correct title but empty
content after fully quitting (Cmd+Q) and reopening VS Code - even though
CLAUDE_CONFIG_DIR is correctly configured and the underlying .jsonl session
files are intact and up to date. This is a variant of #45424, but that issue
was closed as "not planned" while attributing the symptom to tab-close cache
eviction; this report shows the same symptom occurs even with a verified-correct
config and without explicitly closing tabs (full app quit/relaunch).
Environment
- macOS, VS Code extension (not CLI-only)
- CLAUDE_CONFIG_DIR set via claudeCode.environmentVariables in the profile's
settings.json (not a shell env var / alias), so it applies regardless of how
VS Code is launched (Dock, Spotlight, terminal)
Steps to reproduce
- Work in a project over multiple days/weeks with several session tabs open
- Fully quit VS Code (Cmd+Q)
- Reopen VS Code - previously open tabs restore with correct titles
- Click into a tab - panel is empty ("Untitled", no message history)
Diagnostics performed
- Confirmed claudeCode.environmentVariables in the profile's settings.json
correctly points CLAUDE_CONFIG_DIR to the intended directory
- Confirmed .jsonl session files in that directory are being written
correctly and are current (matching real-time activity, verified by file
mtimes)
- The extension's "Session history" dialog (Local tab) only surfaced sessions
from ~1 month prior, missing weeks of subsequent activity that exists on disk
- Inspected the workspace's state.vscdb (workspaceStorage):
- agentSessions.model.cache is populated (50/50 entries) exclusively by a
different chat provider (openai-codex) - no Claude Code entries, and
unrelated to Claude's own session list per the keys below
- Claude-specific keys (memento/webviewView.claudeVSCodeSessionsList,
workbench.view.extension.claude-sessions-sidebar.state, etc.) only
contain webview UI state (collapsed/size), not an actual session index
- Could not locate a readable on-disk index that would explain the stale
tab/session-list state - the actual session index appears to live in
extension-host memory and does not get correctly rebuilt/rehydrated on
reopen
Expected behavior
Session tabs and the "Session history" list should reflect the actual
.jsonl files on disk, especially given CLAUDE_CONFIG_DIR is explicitly and
correctly configured. Env misconfiguration can be ruled out as the cause here.
Workaround
claude --resume in the terminal correctly finds and resumes all sessions
that are invisible in the VS Code UI, confirming the data itself is intact.