VS Code sidebar ignores `ai-title` and shows later user prompt as session label
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
- Open a Claude Code session in VS Code; have a multi-turn conversation so that
ai-titleis generated and written to the.jsonl. - Continue the conversation with several more user messages.
- Close the session / restart VS Code.
- 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
labelset to the truncated later prompt (ending mid-codepoint with a replacement character). - When I manually overwrote the
labelto the correctaiTitleand 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
lastPromptvsfirstPrompt(this bug is a variant thataiTitleis still ignored) - #32150 — open;
custom-titlevslast-promptordering issue - #49842 — open;
/renametitle 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
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗