[VSCode] Renaming session via sidebar pencil icon doesn't sync terminal tab title — next message overwrites the custom name

Open 💬 10 comments Opened Mar 23, 2026 by OQAY

Bug Description

When renaming a session using the pencil icon in the sidebar session list (VS Code extension UI), the rename only applies to the sidebar label. The terminal tab title remains unchanged with the old auto-generated name.

On the next Claude response or user message, the auto-generated terminal tab title overwrites the custom name back in the sidebar — effectively losing the rename.

Steps to Reproduce

  1. Open a Claude Code session in VS Code
  2. Send a message (e.g., about updating a library) — the terminal tab gets auto-titled (e.g., "Update BMAD library")
  3. In the left sidebar (session list), click the pencil/edit icon next to the session
  4. Rename it to something else (e.g., "teste rename")
  5. The sidebar shows the new name, but the terminal tab still shows the old auto-generated title
  6. Send any new message or wait for Claude's response
  7. Bug: The sidebar name reverts back to the auto-generated terminal title (e.g., "Update BMAD library"), losing the custom name

Expected Behavior

  • Renaming via the sidebar pencil icon should also update the terminal tab title
  • The custom name should persist and not be overwritten by auto-generated titles
  • Behavior should match /rename command which correctly syncs both sidebar and terminal tab

Actual Behavior

  • Sidebar rename and terminal tab title are out of sync
  • The terminal tab title takes priority and overwrites the sidebar custom name on the next message cycle
  • The rename is effectively lost

Screenshot

The sidebar shows "teste rename" (custom name), but the terminal tab still shows "Update BMAD library" (auto-generated). After the next message, "teste rename" gets overwritten back to "Update BMAD library".

Environment

  • Claude Code version: 2.1.81
  • VS Code: Windows 11 Pro
  • Extension: Claude Code (native VS Code extension)

Workaround

Using /rename "name" command inside the session works correctly — it syncs both the sidebar and the terminal tab title. The bug is specific to the sidebar pencil icon rename UI.

Related Issues

  • #25789 — /rename now updates terminal tab title (fixed, but only for /rename command)
  • #23610 — Custom session titles lost after resuming
  • #26121 — Session name lost after context compaction
  • #36077 — /resume does not display custom session names

Suggested Fix

When the user renames a session via the sidebar UI (pencil icon), the extension should:

  1. Update the session metadata (as it currently does)
  2. Also send a terminal title update (ESC ]0; sequence or VS Code API terminal.name)
  3. Set a flag marking this as a user-defined name, preventing auto-generated titles from overwriting it (same logic already used by /rename)

Essentially, the sidebar rename should internally trigger the same code path as /rename.

View original on GitHub ↗

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