VSCode: Sessions disappear from sidebar — mtime-based listing drops older sessions
Bug
Claude Code sessions disappear from the VSCode sidebar immediately — sessions created earlier the same day are never visible in the list. They exist on disk as .jsonl files with full valid content, but the UI never shows them. Search within the session list also doesn't find them.
Steps to Reproduce
- Create several Claude Code sessions throughout the day
- Open the sessions list in the sidebar
- Sessions from earlier today are missing — they were never visible, not even briefly
- The
.jsonlfiles are present in~/.claude/projects/<hash>/with full content
Root Cause (from reverse-engineering extension.js v2.1.72)
The session listing pipeline works as follows:
Vj()scans the project directory for*.jsonlfiles usingvscode.workspace.fs.readDirectory()Qs()reads the first 64KB (KN = 65536) and last 64KB of each file to extract metadata (first prompt, last prompt, timestamps)ns()extractsfirstPromptfrom the head bufferUN()extractslastPromptfrom the tail buffer- Sessions are sorted by file
mtime
The UI filters sessions with: sessions.value.filter((J) => J.messages.value.length > 0 || J.isOffline() || J.isLoading.value || J.isExplicit.value)
The problem appears to be that sessions with older mtime values are either:
- Not loaded at all (some kind of limit/pagination that isn't visible in the minified source)
- Filtered out by a condition that effectively caps how many sessions are shown
Evidence
- Sessions from earlier the same day are never visible — not even once
- Sessions from 2 days ago are somehow visible, while today's sessions are not
- The
.jsonlfiles exist, are non-empty, and contain valid data touch-ing the.jsonlfile does NOT reliably make the session reappearDeveloper: Reload Windowmay bring a session back, but not consistentlysessions-index.jsonis not used by the extension — it scans.jsonlfiles directly. Populating the index with entries actually caused a separate bug.
No Known Workaround
There is no reliable way to bring back disappeared sessions. touch on the file, reloading the window — none work consistently.
Expected Behavior
All sessions should remain visible in the sidebar (or at minimum be findable via search), regardless of age. If pagination is needed for performance, there should be a "load more" or "show all" option.
Environment
- Claude Code extension v2.1.72
- VSCode (remote SSH to TrueNAS/Debian 12)
- ~100+ session files in the project directory
- Linux x64
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗