VS Code sidebar ignores `ai-title` and shows later user prompt as session label

Resolved 💬 1 comment Opened Apr 18, 2026 by AndyHaack Closed May 25, 2026

Summary

The VS Code Claude Code extension displays a truncated later user prompt as the session label in the sidebar, even when the session's .jsonl file contains a valid ai-title entry with a meaningful auto-generated title.

Per the title-resolver priority described in #49996 (customTitle || aiTitle || lastPrompt || summary || firstPrompt), aiTitle should take precedence over lastPrompt. In my case it does not — the sidebar shows a later user message instead of the stored aiTitle.

#49996 is closed, but it only addressed the lastPrompt vs firstPrompt ordering for sessions without an aiTitle. Sessions that do have an aiTitle (written twice at lines 6 and 7 of the .jsonl in my case) are still mis-labeled in the sidebar. This suggests the sidebar-cache rebuild path (on workspace reload / cache regeneration) is not reading ai-title from the session file.

Reproduction

  1. Open a Claude Code session in VS Code; have a multi-turn conversation so that ai-title is generated and written to the .jsonl.
  2. Continue the conversation with several more user messages.
  3. Close the session / restart VS Code.
  4. Observe the sidebar entry — it shows a truncated later user prompt instead of the aiTitle.

Concrete example

Session file (%USERPROFILE%\.claude\projects\C--Enginatics-blitz-report\8a8575ba-a0ef-44d6-9b84-7798ababf35b.jsonl) contains:

{"type": "ai-title", "aiTitle": "Fix custom form compatibility after BR upgrade", "sessionId": "8a8575ba-..."}
{"type": "ai-title", "sessionId": "8a8575ba-...", "aiTitle": "Fix custom form compatibility after BR upgrade"}

Actual VS Code sidebar label:

Just put the corrected file into the c:\Tem...

Expected sidebar label:

Fix custom form compatibility after BR upgrade

claude --resume 8a8575ba-... shows the correct title, confirming the aiTitle is readable and intact.

Cache manipulation test

I inspected agentSessions.model.cache in %APPDATA%\Code\User\workspaceStorage\<ws>\state.vscdb:

  • The cache entry for this session has label set to the truncated later prompt (ending mid-codepoint with a replacement character).
  • When I manually overwrote the label to the correct aiTitle and reloaded VS Code, the extension rebuilt the cache and reverted the label back to the truncated later prompt.

This confirms the extension's cache-population logic (not just a stale cache value) is sourcing the wrong field.

Related

  • #49996 — closed; title resolver lastPrompt vs firstPrompt (this bug is a variant that aiTitle is still ignored)
  • #32150 — open; custom-title vs last-prompt ordering issue
  • #49842 — open; /rename title gets overwritten

Environment

  • Claude Code: 2.1.89
  • VS Code: 1.116.0
  • OS: Windows 11 Pro 10.0.26200
  • Platform: platform:vscode, platform:windows

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗