Sessions disappear from history when first message is a slash command

Resolved 💬 3 comments Opened Feb 28, 2026 by dcbenji Closed Mar 4, 2026

Bug Description

Sessions become invisible in the VS Code extension sidebar when the first user action in the session is a slash command (like /model, /compact, or a custom skill command).

Steps to Reproduce

  1. Open Claude Code in a VS Code fork (tested in Antigravity/Windsurf with extension v2.1.49)
  2. Start a new session
  3. Run /model sonnet (or any slash command) as the first action
  4. Have a substantive multi-message conversation
  5. Close or navigate away from the session
  6. Open the session history — the session is missing from the list

Expected Behavior

All sessions with content should appear in the session list, even if the display title has to fall back to "Untitled session" or a timestamp.

Actual Behavior

The session is completely invisible in the sidebar. The .jsonl file exists on disk and contains the full conversation, but the UI doesn't show it.

Root Cause (from reverse-engineering extension.js)

fetchSessions() reads each .jsonl file's head (first line) and tail (last N bytes) to derive a display title:

  1. Checks tail for customTitle (from /rename)
  2. Checks tail for summary (auto-generated)
  3. Extracts first user prompt from head (first JSONL line)

If all three return null, the session is filtered out via if(!D) return null.

When the first action is a slash command, the first JSONL line has "type": "system" with empty/command content instead of "type": "user" with a real prompt. The head-parser can't extract a display string, and if no customTitle or summary exists in the tail, the session gets dropped.

Impact

In my project, 108 out of 301 session files (~36%) were missing from the session list. Many of these were substantive multi-hour sessions that started with a slash command.

Suggested Fix

In fetchSessions(), instead of returning null when no display title can be derived, fall back to a default like:

  • The session's modification date
  • "Untitled session"
  • Parse deeper into the file for the first actual user message (not just the first line)

Environment

  • Claude Code extension v2.1.49
  • macOS (Darwin 25.2.0, arm64)
  • Tested in Antigravity and Windsurf VS Code forks

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗