Skip to content

[BUG] Past conversations not showing in dropdown - sessions-index.json not being updated. #18619

Open

Description

@sethgi

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

@claude Claude Code has written the following bug report:

Bug Report: Past Conversations Not Appearing in Dropdown

Summary

Past conversations are not showing up in the conversation history dropdown in Claude Code VSCode extension, despite session files being created and stored on disk.

Environment

  • Claude Code Extension Version: 2.1.9
  • VSCode Version: 1.106.0 (commit: ac4cbdf48759c7d8c3eb91ffe6bb04316e263c57)
  • Operating System: Linux 6.8.0-90-generic (Ubuntu 22.04.1)
  • Architecture: x86_64

Expected Behavior

All conversation sessions should appear in the conversation history dropdown, allowing users to switch between past and current conversations.

Actual Behavior

The conversation history dropdown does not show past conversations, even though session files exist on disk.

Root Cause Analysis

Investigation reveals that the sessions-index.json file is not being updated with new sessions:

  1. Sessions Index: Located at ~/.claude/projects/-home-user-my-project/sessions-index.json

    • Last modified: 2026-01-16 16:38:59 UTC
    • Contains 3 session entries
  2. Actual Session Files: Located at ~/.claude/projects/-home-user-my-project/*.jsonl

    • Found 4 session files (not 3)
    • Current session file: 9d858d39-dde4-4546-b754-e8bac989a894.jsonl
    • Last modified: 2026-01-16 16:44:00 UTC (6 minutes after index was updated)
  3. The Problem: The current active session (and potentially others) are not being added to sessions-index.json, which appears to be the source of truth for the dropdown menu.

Steps to Reproduce

  1. Start a new conversation in Claude Code VSCode extension
  2. Have a conversation with Claude
  3. Try to access past conversations via the dropdown
  4. Observe that the current (and possibly other recent) conversations don't appear

Evidence

Sessions Index Content

{
  "version": 1,
  "entries": [
    {
      "sessionId": "9e1d49c5-0884-4f92-9ff5-52f436946d11",
      "fullPath": "/home/user/.claude/projects/-home-user-my-project/9e1d49c5-0884-4f92-9ff5-52f436946d11.jsonl",
      "fileMtime": 1768581224044,
      "firstPrompt": "<ide_opened_file>The user opened a file in the IDE...",
      "messageCount": 13,
      "created": "2026-01-16T16:31:20.540Z",
      "modified": "2026-01-16T16:33:44.039Z",
      "gitBranch": "feature-branch",
      "projectPath": "/home/user/my-project",
      "isSidechain": false
    },
    {
      "sessionId": "2bae9b7f-c473-4685-b1ab-67c032ca4752",
      "fullPath": "/home/user/.claude/projects/-home-user-my-project/2bae9b7f-c473-4685-b1ab-67c032ca4752.jsonl",
      "fileMtime": 1768581451003,
      "firstPrompt": "<ide_opened_file>The user opened a file in the IDE...",
      "messageCount": 5,
      "created": "2026-01-16T16:36:42.663Z",
      "modified": "2026-01-16T16:37:30.999Z",
      "gitBranch": "feature-branch",
      "projectPath": "/home/user/my-project",
      "isSidechain": false
    },
    {
      "sessionId": "e49ffeca-cc0f-4dc1-bd87-9b95285a2850",
      "fullPath": "/home/user/.claude/projects/-home-user-my-project/e49ffeca-cc0f-4dc1-bd87-9b95285a2850.jsonl",
      "fileMtime": 1768581491872,
      "firstPrompt": "<ide_opened_file>The user opened a file in the IDE...",
      "messageCount": 5,
      "created": "2026-01-16T16:32:04.645Z",
      "modified": "2026-01-16T16:38:11.869Z",
      "gitBranch": "feature-branch",
      "projectPath": "/home/user/my-project",
      "isSidechain": false
    }
  ]
}

File Timestamps

-rw------- 1 user user 154K Jan 16 16:37 2bae9b7f-c473-4685-b1ab-67c032ca4752.jsonl
-rw------- 1 user user  34K Jan 16 16:44 9d858d39-dde4-4546-b754-e8bac989a894.jsonl  <-- MISSING FROM INDEX
-rw------- 1 user user 241K Jan 16 16:33 9e1d49c5-0884-4f92-9ff5-52f436946d11.jsonl
-rw------- 1 user user 300K Jan 16 16:43 e49ffeca-cc0f-4dc1-bd87-9b95285a2850.jsonl
-rw------- 1 user user 2072 Jan 16 16:38 sessions-index.json  <-- NOT UPDATED SINCE 16:38

Session File Structure

The missing session file (9d858d39-dde4-4546-b754-e8bac989a894.jsonl) is a valid JSONL file with proper structure:

  • SessionId: 9d858d39-dde4-4546-b754-e8bac989a894
  • Created: 2026-01-16T16:41:20.339Z
  • Version: 2.1.9
  • Contains valid conversation data

Hypothesis

The sessions-index.json file may only be updated when:

  1. A session is properly closed/ended
  2. VSCode/the extension is restarted
  3. Some other trigger condition is met

Active/current sessions may not be indexed immediately, causing them to not appear in the dropdown.

Impact

  • Users cannot access their conversation history through the UI
  • This breaks the workflow for users who want to reference or continue past conversations
  • The data exists on disk but is not accessible through the interface

Possible Solutions

  1. Update the sessions index in real-time as sessions are created
  2. Implement a "refresh" mechanism to rebuild the index from disk
  3. Add a fallback that scans for session files if they're missing from the index
  4. Ensure sessions are indexed before they become visible to the user

Workaround

None currently available through the UI. Manual editing of sessions-index.json is not recommended as it may cause other issues.

Additional Notes

  • File permissions appear correct (0600 for session files)
  • No error messages visible in debug logs (~/.claude/debug/latest)
  • Session files are being created and written to correctly
  • The issue appears to be specifically with the indexing mechanism

What Should Happen?

Expected Behavior

All conversation sessions should appear in the conversation history dropdown, allowing users to switch between past and current conversations.

Actual Behavior

The conversation history dropdown does not show past conversations, even though session files exist on disk.

Error Messages/Logs

Steps to Reproduce

Steps to Reproduce

  1. Start a new conversation in Claude Code VSCode extension
  2. Have a conversation with Claude
  3. Try to access past conversations via the dropdown
  4. Observe that the current (and possibly other recent) conversations don't appear

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

2.1.9

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

VS Code integrated terminal

Additional Information

No response

Activity

  1. github-actions commented on Jan 16, 2026

    @github-actions

    Found 3 possible duplicate issues:

    1. VS Code Extension: Past Conversations not loaded after restart #12872
    2. [BUG] No Way to Access Past Conversions in VS Code Extension #16290
    3. [BUG] Conversation History disappeared after update. #12908

    This issue will be automatically closed as a duplicate in 3 days.

    • If your issue is a duplicate, please close it and 👍 the existing issue instead
    • To prevent auto-closure, add a comment or 👎 this comment

    🤖 Generated with Claude Code

  2. sethgi commented on Jan 16, 2026

    @sethgi
    Author

    I don't believe this is exactly a duplicate...

    #12872: describes conversations disapearing after a restart, but mine never show up at all
    #16290: is not very specific and i'm not sure exactly what they're describing
    #12908: similarly seems out of date and describes a past update.

  3. kdmyers56 commented on Jan 17, 2026

    @kdmyers56

    Adding evidence from macOS (Claude Desktop App 1.1.351) that confirms this issue:

    Key finding: The sessions-index.json file is not just failing to update - it's not being created at all for some projects.

    Filesystem evidence:

    # Project WITH index (sessions appear in UI):
    ~/.claude/projects/-Users-kmyers-atomo-commercialization-dsl/
      ├── sessions-index.json  ✅ EXISTS
      └── 4 session .jsonl files
    
    # Project WITHOUT index (sessions MISSING from UI):
    ~/.claude/projects/-Users-kmyers-Kelly-Customers-Definium-Therapeutic--MindMed----Matt-Wiley-/
      ├── NO sessions-index.json  ❌ MISSING
      └── 4 session .jsonl files (30MB+ of data)
    
    # Another project WITHOUT index:
    ~/.claude/projects/-Users-kmyers-Kelly-Customers-White-Plains-Hospital---Tony-Mercando--WPH-Data/
      ├── NO sessions-index.json  ❌ MISSING
      └── 2 session .jsonl files
    

    The session data is fully intact - it's only the index that's missing. This suggests the index file creation may be failing silently for certain project paths.

    Feature request: A claude sessions reindex command (or automatic detection) would recover all these "lost" sessions.

    (Closing my duplicate #18897 in favor of this issue)

  4. glhrmv commented on Jan 19, 2026

    @glhrmv

    This may or may not be related but I am experiencing this issue and, in my particular scenario, I installed claude-code through brew --cask install in a different user than the user I normally invoke claude in.

  5. c0ding-L commented on Jan 19, 2026

    @c0ding-L

    I found that there were unamed (with empty 'firstPrompt') sessions after executing the following command:
    $ nano /home/user/.claude/projects/-home-user-my-project/sessions-index.json
    So, I just filled the adequate name for that session, saved the file, executed claude --resume, and found the session

    Hope it helps

  6. HelixX23 commented on Jan 19, 2026

    @HelixX23

    @claude fix this issue

  7. HelixX23 commented on Jan 19, 2026

    @HelixX23

    @claude do you see a problem fixing this issue?

  8. johan-kjolhede-kivra commented on Jan 20, 2026

    @johan-kjolhede-kivra

    seems like sessions-index.json gets populated the next time I start claude code, not when I shut it down after completing a conversation. It would for sure be nicer to populate immediately when I shut down

  9. H0w4rd commented on Jan 20, 2026

    @H0w4rd

    Investigation Report: Past Conversations Empty in VS Code Extension

    I asked Claude Code to help me debug this issue. Here's what we found:

    Initial Investigation

    We cloned the claude-code repository, but discovered that the extension source code is not open source - the repository only contains plugins and
    documentation. The actual CLI and VS Code extension code is minified and bundled.

    Root Cause

    The bug is a path resolution inconsistency between CLI and VS Code extension:

    • CLI resolves symlinks and uses the canonical path (e.g., /data2/home/user/project)
    • VS Code extension uses the path as provided by VS Code (e.g., /home/user/project if opened via symlink)

    This causes sessions to be stored in different directories under ~/.claude/projects/:

    • CLI stores in: -data2-home-user-project/
    • Extension looks in: -home-user-project/

    This affects anyone whose home directory or project path involves symlinks or bind mounts.

    Workaround

    We found two workarounds:

    1. Create symlinks in ~/.claude/projects/ mapping the extension's expected path to CLI's actual path:
      ln -s ./-data2-home-user-project ./-home-user-project                                                                                                                                                    
                                                                                                                                                                                                               
    2. Modify VS Code's stored paths in ~/.config/Code/User/globalStorage/state.vscdb to use resolved paths, so VS Code opens projects with the same path CLI uses.

    Proposed Fix

    The CLI and extension should use consistent path resolution. Options:

    1. Both resolve symlinks - Call realpath() / fs.realpath() on the project path before generating the storage directory name
    2. Both use paths as-is - Don't resolve symlinks in CLI
    3. Normalize at storage level - Resolve symlinks when determining the ~/.claude/projects/ directory, regardless of how the path was provided

    Option 1 or 3 would be the cleanest solution, ensuring sessions are always stored and retrieved from the same location regardless of how the project was opened.

    Environment

    • OS: Linux (Debian)
    • VS Code Extension: anthropic.claude-code
    • Home directory on separate disk mounted via symlink
  10. rjmayott commented on Jan 20, 2026

    @rjmayott

    Same issue on Aurora Linux. I also originally installed via brew --cask install claude-code

  11. gudzenkov commented on Jan 23, 2026

    @gudzenkov

    May not be exactly related, but having a similar issue on MacOS DevContainer for sessions with {"type": "file-history-snapshot", ...} instead of {"type": "summary"
    #16579

  12. cardaconsultancy commented on Jan 30, 2026

    @cardaconsultancy

    This may or may not be related but I am experiencing this issue and, in my particular scenario, I installed claude-code through brew --cask install in a different user than the user I normally invoke claude in.

    No I have the same issue, and a buddy of mine too, using the VSCode IDE.

  13. TheGrouchy commented on Feb 7, 2026

    @TheGrouchy

    Bumped! This issue is locking me out of very important sessions, i have to find them call them by session id only and am forced to keep my session count low. when i need at least a few to work properly in Worktree.

  14. jdarren commented on Feb 10, 2026

    @jdarren

    Yeah, just ran into this one as well. Pretty bad UX to not be able to find your sessions.

  15. hi-fox commented on Feb 11, 2026

    @hi-fox

    I am also seeing this, my session index for some projects is truncated and not showing all sessions from the actual project folder of jsonl files, and some projects have no session index at all.

  16. nabilowitsch commented on Feb 13, 2026

    @nabilowitsch

    The following workaround helped in my case: Manually create the missing sessions-index.json file with the following content:

    { "version": 1, "entries": [] }

    When I open the project again and start a new conversation with Claude Code, it automatically recalls the previous conversations again.

  17. Lcstyle commented on Feb 13, 2026

    @Lcstyle

    Escalation: project directory never created — sessions never persisted to disk

    Adding a more severe variant from native Linux (not WSL).

    Environment

    • Claude Code: 2.1.41
    • OS: Fedora 43, kernel 6.18.8-200.fc43.x86_64
    • Shell: CLI terminal (not IDE)

    The finding

    For the project ~/Documents/RustroverProjects/cosmic-term, the entire project directory under ~/.claude/projects/ was never created. Not the index — the directory itself and all session .jsonl files are missing.

    Evidence that Claude Code sessions occurred:

    $ cd ~/Documents/RustroverProjects/cosmic-term
    $ git log --format='%h %ai %s' --since=2026-02-10 --until=2026-02-13 | head -10
    bb125c5 2026-02-12 21:21:39 -0500 fix: restore sessions as independent processes with split layout support
    5138171 2026-02-12 17:38:30 -0500 fix: graceful exit saves all tabs, not just pinned
    3624fa9 2026-02-12 17:27:14 -0500 feat: show restore banner with session timestamps
    3809a2f 2026-02-12 16:49:37 -0500 fix: prevent zombie processes on session restore
    94c4537 2026-02-11 12:22:16 -0500 fix: only restore sessions on first launch
    a8e562f 2026-02-11 11:02:02 -0500 fix: add 10s timeout to AI title suggestion API call
    

    Every one of these commits has Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>, proving multi-hour Claude Code sessions happened from this project directory.

    What is missing:

    $ ls ~/.claude/projects/-home-lcstyle-Documents-RustroverProjects-cosmic-term/ 2>&1
    ls: cannot access '...': No such file or directory
    

    No project directory. No sessions-index.json. No .jsonl files. Zero session data on disk.

    Why this is different from other reports

    Every other report in this thread (and in #23614, #23421, #22205) describes .jsonl session files that exist on disk but are not indexed/shown in the picker. Those are recoverable — you can rebuild the index or claude --resume <id>.

    This variant is permanent data loss. The project directory was silently never created, so session data was never written. There is nothing to recover.

    Same machine confirms the index bug too

    On the same machine, a different project (~/.claude/projects/-home-lcstyle/) has 39 .jsonl files but only 7 indexed entries (stale since Jan 21). This confirms the index-staleness bug from #23614 exists in parallel. But for the cosmic-term project, the problem is one level deeper: the persistence layer itself failed silently.

    Possible root cause

    The project path is ~/Documents/RustroverProjects/cosmic-term which maps to -home-lcstyle-Documents-RustroverProjects-cosmic-term. Nothing obviously pathological about this path (no special chars, reasonable length). The mkdir-equivalent that should create the project directory under ~/.claude/projects/ may be failing silently, or there may be a race condition where session data is written to a path that was never created.

  18. Lcstyle commented on Feb 13, 2026

    @Lcstyle

    Update: sessions found — root user path split, not data loss

    Correction to my previous comment. The "missing" cosmic-term sessions were found under /root/.claude/projects/ rather than /home/lcstyle/.claude/projects/. The user had been running claude as root (via sudo), so sessions were persisted under root's home directory. Not permanent data loss — the sessions exist and are resumable.

    However, this reveals a different UX problem: running claude as root vs. as the normal user splits session storage across two separate ~/.claude/ trees, and the /resume picker only shows sessions for the current user. There's no indication this is happening and no way to see sessions from the other user's store.

    What was actually broken (still valid)

    The sessions-index.json staleness bug is confirmed on both user accounts on the same machine:

    User Project dir .jsonl files on disk Indexed entries Index stale since
    lcstyle -home-lcstyle/ 39 7 Jan 21
    root -home-lcstyle/ 247 39 ~late Jan
    root -home-lcstyle-Documents-RustroverProjects/ 15 5 Jan 23
    root -home-lcstyle-Downloads/ 9 3 stale
    root -home-lcstyle-Documents-RustroverProjects-cosmic-kb/ 3 0 never

    9 additional root project directories had no index at all despite having session files.

    Environment

    • Claude Code: 2.1.41
    • OS: Fedora 43, kernel 6.18.8
    • Both root and normal user affected identically
  19. hi-fox commented on Feb 13, 2026

    @hi-fox

    The following workaround helped in my case: Manually create the missing sessions-index.json file with the following content:

    { "version": 1, "entries": [] }

    When I open the project again and start a new conversation with Claude Code, it automatically recalls the previous conversations again.

    Is it actually populating the sessions-index file though? The latest versions ignore this file completely and populate the recent chat lists from just recently modified jsonl files from the project directory, it skips the session index entirely.

  20. robertbpugh commented on Feb 16, 2026

    @robertbpugh

    +1. macOS 15.4, Claude Code CLI (not VS Code extension).

    97 session files on disk, 8 entries in sessions-index.json. Only seeing ~8% of my history in /resume.

    Discovered it while trying to find a session from a week ago where I built a Google Apps Script workflow. Had to grep through the raw JSONL files to recover the context.

  21. interconnectedMe commented on Mar 16, 2026

    @interconnectedMe

    This issue is part of a family of ~20 bugs that all stem from the same root cause: the VS Code extension reads titles by raw-string-scanning the last 64KB of each JSONL file, which causes title eviction on long sessions, cross-session contamination from tool result content, and overwrite-on-resume.

    See #33165 (comment: #33165 (comment)) for the full root cause analysis, all related issues collected, and a working workaround (persistent title registry + hook).

  22. mookilyu commented on Mar 20, 2026

    @mookilyu

    Any updates?

  23. rayyang2000 commented on Apr 17, 2026

    @rayyang2000

    Any ETA? The history is still missing. I feel this extension UI is much better than any terminals on Windows - it's easy to copy shell commands by just one click without selecting anything - compared to the standard terminal behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:corearea:idebugSomething isn't workinghas reproHas detailed reproduction stepsplatform:linuxIssue specifically occurs on Linuxplatform:macosIssue specifically occurs on macOSplatform:vscodeIssue specifically occurs in VS Code

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions