[BUG] Renaming a session never updates its currently-open editor tab title (VS Code extension)
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Running /rename <new title> in an active session prints its normal confirmation, but doesn't visibly update anything: not the currently open editor tab's title, and not that session's entry in the history list either. Editing the name directly on a history list entry via its pencil/edit icon does show the new name in that entry — but that's just the text field you typed into, not evidence of a live refresh — and even then, the open editor tab for that session still keeps showing the old title.
So there appear to be two related gaps:
/renamedoesn't update the history list entry at all (only directly editing the entry does).- The open editor tab's title never updates after any rename method, including the direct history-list edit.
What Should Happen?
Expected behavior:/rename should update the history list entry immediately. The open editor tab's title should update to match the current name shortly after any rename, without requiring the session to be closed and reopened.
Error Messages/Logs
Steps to Reproduce
- Open a session in the Claude Code VS Code extension.
- Run
/rename Some New Title. - Check the session history list — the entry still shows the old title.
- Check the currently open editor tab for that session — it still shows the old title.
- Instead, edit that session's name directly via the pencil/edit icon on its history list entry — the entry now shows the new name (because you typed it there).
- Check the currently open editor tab again — it still shows the old title.
- Switching tabs / focus does not trigger a refresh in any of the above.
Claude Model
Sonnet (default)
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
2.1.201 (Claude Code)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_
3 Comments
Still reproduces on extension v2.1.251 — and not only on Windows. I hit this on macOS driving a Linux dev container, so the
platform:windowslabel is probably too narrow.I dug through the shipped bundle to find the mechanism, in case it saves someone time.
Why the tab title never updates
The editor tab label isn't state the extension holds independently — it's pushed from the webview.
extension.jsassigns it in exactly one place:and
webview/index.jssends it from a reactive effect:So the tab label is
activeSession.summary, truncated to 24 chars. It changes only when that signal changes.Why
/renamedoesn't change it/renamepersists correctly — it writes<session-id>/custom-title.jsonand appends{"type":"custom-title",…}records into the transcript. But nothing pushes the new value intosummary.value:createFileSystemWatcherandfs.watch(are both absent fromextension.js), so the on-disk change is never noticed.if (!i.hasPersistedTitle.value) i.summary.value = u.title;A
/renametherefore disqualifies itself from the only path that would have updated the label. Same root cause for the history list entry, since both surfaces read the same session objects.What does fix it
Any
listSessionscall, becausedoListSessionsupdates existing sessions in place:Confirmed by testing: after a
/rename, opening the Resume conversation dialog (which callslistSessions("sessions_dialog")) and pressing Esc updates both the history list entry and the open editor tab title immediately, with no reload.Workaround for anyone hitting this now
/rename <name>, close the session using the editor tab x button then open from side panel list.Developer: Reload Webviewsalso works, but it is far more disruptive than it looks: it tears down and restarts the session's CLI process, interrupting an in-flight turn. I verified this by watching the session pid change at the moment of the reload.Suggested fix
The machinery already exists. The sidebar's state-sync effect has a branch for exactly this case:
That branch fires a re-list when a session which already has a persisted title reports a changed title in its state broadcast — precisely the
/renamecase. It appears not to fire, which suggests the broadcast session state'stitleisn't updated when/renameruns. If that's right, the fix is to have the rename update the broadcast title, rather than to add a filesystem watcher — the absence of watchers looks deliberate.I can only read the shipped bundle, not the CLI side, so I can't tell whether the title is never broadcast or is dropped before it reaches the webview. Either way the existing
state_syncpath looks like the intended mechanism.---
<sub>Bundle analysis done with Claude Code (Opus 5), reading the shipped v2.1.251 extension. The reproduction, the "Resume conversation" workaround, and the process restart on
Developer: Reload Webviewswere each confirmed by a human in the VS Code UI.</sub>I have this problem on Mac as well.
fixed in 2.1.285