Session rename in sidebar does not update tab title

Resolved 💬 3 comments Opened Mar 30, 2026 by deepbluedm Closed Apr 3, 2026

Bug Description

When renaming a session in the sidebar (left panel), the tab title does not update to reflect the new name. The sidebar correctly shows the renamed title, but the tab continues displaying the old auto-generated title (e.g., first message preview).

Steps to Reproduce

  1. Open Claude Code in VS Code with multiple sessions
  2. Right-click a session in the sidebar → Rename → Enter new name (e.g., "Julia Musical")
  3. Observe: sidebar shows "Julia Musical" ✅
  4. Observe: tab still shows old title like "E vamos falar agora sobre..." ❌

Expected Behavior

The tab title should update immediately when the session is renamed in the sidebar, without requiring the user to close and reopen the tab.

Current Workaround

Close the tab and reopen the session from the sidebar — the tab then picks up the correct custom-title from the JSONL file. This is disruptive when working with many sessions simultaneously.

Root Cause (from extension source analysis)

The sidebar reads custom-title entries from the JSONL session file correctly. However, the tab title is only set via the webview's internal renameTab() reactive effect, which doesn't re-trigger when the JSONL file is updated externally (or even by the sidebar rename flow).

In extension.js:

  • Sidebar rename correctly appends {"type":"custom-title","sessionId":"...","customTitle":"..."} to the JSONL
  • Tab title is set via this.panelTab.title = z.request.title only when the webview sends a rename_tab message
  • The rename flow updates customTitles map but does not propagate to already-open WebviewPanel.title

Suggested Fix

After writing the custom-title to the JSONL and updating the customTitles map, also update the corresponding WebviewPanel.title for the session's open tab (if any):

// In the rename handler, after saving to JSONL:
const panel = this.sessionPanels.get(sessionId);
if (panel) {
  panel.title = newTitle;
}

Impact

This significantly affects users who work with multiple simultaneous sessions (10+). Without reliable tab titles, navigating between tabs becomes guesswork — especially after a VS Code restart where all titles revert to auto-generated summaries.

Environment

  • VS Code Extension: anthropic.claude-code v2.1.78 (win32-x64)
  • OS: Windows 11 Pro
  • Platform: VS Code desktop

🤖 Generated with Claude Code

View original on GitHub ↗

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