Let the editor-tab title read from the session summary line for slash-command-launched sessions (VS Code)
Component: Claude Code — VS Code extension
Version: 2.1.187
Platform: Windows 11
Type: Feature request (with a clear, minimal-change option)
---
One-sentence summary
When a session is launched by a slash command, the VS Code editor tab renders the raw slash-command wrapper (e.g. it reads "Send my-token" or "/thea"), and a Stop-hook that rewrites the session's summary line has no effect on the tab — I'd like a way to make the tab read from the (clean) summary line instead.
---
The precise behavior
What determines the tab title today
For a slash-command-launched session, the tab is rendered from the command wrapper that Claude Code stores as the first user message — not from the session's {"type":"summary"} line, and it does not update when a Stop hook rewrites that summary.
Reproduction (5 steps, deterministic)
- Define any custom slash command / skill (e.g.
/send, or an agent command like/thea). - Launch a session by invoking it:
/send my-token. - Claude Code stores the first user message as the command wrapper (verbatim from a real transcript):
````
<command-message>send</command-message>
<command-name>/send</command-name>
<command-args>my-token</command-args>
- The editor tab renders "Send my-token" (for a bare agent command like
/thea, the tab reads "/thea" — leading slash included). - Register a
Stophook that rewrites the transcript's summary line to a clean value — e.g. via a rename tool that writes:
``json``
{"type":"summary","summary":"my-token","leafUuid":"..."}
Result: the tab does NOT change. It still shows "Send my-token". The extension keeps the command-message/verb and ignores the rewritten summary for this tab.
The smoking gun (real transcript from my workspace)
A single session file simultaneously contains a clean summary line and the raw wrapper as its first message — and the tab showed the wrapper form:
- Stored summary line (my
Stophook rewrote it correctly):
``json``
{"type":"summary","summary":"command-board-roll.s1","leafUuid":"09601915-939a-44c4-acad-e614e4079e48"}
- First user message (what the tab actually rendered from):
````
<command-message>send</command-message>
<command-name>/send</command-name>
<command-args>command-board-roll.s1</command-args>
- Tab displayed:
Send command board roll← the wrapper wins; my cleancommand-board-roll.s1summary is ignored.
Proof it is launch-method-specific (the control case)
If I paste the same token as plain text instead of via the slash command, there is no command wrapper, the extension falls back to my rewritten summary, and the tab renders correctly:
- First user message:
command-board-sweep.s1(plain text, no wrapper) - Tab displayed:
Command board sweep← clean.
So the tab-title source differs purely by launch method: plain-text paste → summary line (clean); slash-command launch → command wrapper (verb-prefixed).
My Stop hook (for reference — this is the documented way to name sessions)
{ "hooks": { "Stop": [ { "hooks": [
{ "type": "command", "command": "python \"$CLAUDE_PROJECT_DIR/.claude/hooks/auto-name.py\"", "timeout": 15 }
] } ] } }
The hook writes/updates the {"type":"summary"} first line of the .jsonl transcript. This works for plain-text-launched tabs; it has no effect on slash-launched tabs.
---
Before / after (what I see vs. what I want)
| Launch | First message stored | Tab shows today | Tab I'd like |
|---|---|---|---|
| /send command-board-roll.s1 | <command-message>send</command-message>… | Send command board roll | command-board-roll.s1 (my summary) |
| /thea | <command-message>thea</command-message>… | /thea | Thea (or my summary) |
| paste command-board-sweep.s1 (plain text) | command-board-sweep.s1 | Command board sweep ✓ | (already correct) |
---
Why it matters
- A heavy slash-command workflow opens many dispatch/handoff tabs at once. Every one leads with the same verb ("Send …", "Send …", "Send …"), which is visually indistinguishable and pushes the actual identifying token toward truncation.
- Agent/skill sessions read as
/thea,/vigil,/knox— leading slash and all — instead of a clean name. - The documented session-naming mechanism (a
Stop-hook renamer writing the summary line) silently does nothing for these tabs. That's surprising: the summary line is the natural source of truth for a session's display name, and it already governs plain-text-launched tabs.
---
Requested fix (ordered by my preference; any ONE resolves it)
- [Smallest change] Re-read the summary line for the tab when a
Stophook rewrites it. Make slash-launched tabs behave like plain-text-launched ones: if a{"type":"summary"}line exists/updates, the tab reflects it. This reuses the exact path that already works for plain-text tabs — no new setting, no new surface.
- A
sessionNameSourcesetting (settings.json) to choose the tab-title source:
summary-line— the rewritten{"type":"summary"}line (my preferred default)command-message— current behavior for slash launchesfirst-user-message
- A setting to suppress the leading verb/slash in slash-launched tab titles (render
Send XasX,/theaasthea/ a clean name).
Option 1 is likely the least invasive and would fix this for anyone already using a Stop-hook renamer.
---
Environment details (for reproduction)
- Claude Code (VS Code extension) 2.1.187
- OS: Windows 11
- Behavior is consistent across built-in-style dispatch commands (
/send,/resume) and custom agent commands (/thea,/vigil, etc.). - Repro needs only: one custom slash command + a
Stophook that rewrites the transcriptsummaryline.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗