[BUG] VSCode sidebar displays ai-title instead of custom-title during live session despite UserPromptSubmit hook setting custom title
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?
When a UserPromptSubmit hook emits hookSpecificOutput.sessionTitle, the value is correctly persisted to the session JSONL as both custom-title and agent-name records, and the terminal tab title plus /resume picker both display it correctly. However, the VSCode extension sidebar continues to display the auto-generated ai-title for the duration of the live session.
Closing and reopening the session causes the sidebar to display the custom-title correctly, which suggests the cold-load path respects custom-title priority while the live-update path does not.
This appears to be the VSCode-extension counterpart to a known pattern already reported on the Claude Code Desktop app surface in #53023 (closed as duplicate) and #55951 (open). Resolving them together likely involves shared logic.
What Should Happen?
The VSCode sidebar should display the value emitted by the hook (custom-title) during the live session, the same way it does after a close/reopen. When both custom-title and ai-title exist for a session, the sidebar should prefer custom-title — matching the cold-load behavior.
Error Messages/Logs
Steps to Reproduce
- Add a UserPromptSubmit hook to ~/.claude/settings.json:
``json``
{
"hooks": {
"UserPromptSubmit": [{
"matcher": "",
"hooks": [{
"type": "command",
"command": "jq -c 'if (.prompt // \"\" | test(\"^/foo +[0-9]+\")) then {hookSpecificOutput:{hookEventName:\"UserPromptSubmit\",sessionTitle:(\"Custom - \" + (.prompt | capture(\"^/foo +(?<n>[0-9]+)\").n))}} else empty end'"
}]
}]
}
}
- Open a fresh session in the VSCode extension.
- Submit a prompt matching the pattern (e.g.
/foo 12345 do something). - Observe the sidebar title: it shows the auto-generated ai-title (e.g. "Foo something implementation"), not "Custom - 12345".
- Close the session and reopen it from the session history. The sidebar now correctly shows "Custom - 12345".
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.126 (Claude Code)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
VS Code integrated terminal
Additional Information
JSONL Evidence
The session JSONL at ~/.claude/projects/<sanitized-cwd>/<session-uuid>.jsonl contains both records:
{"type":"ai-title","sessionId":"<uuid>","aiTitle":"Foo implementation"}
{"type":"custom-title","customTitle":"Custom - 12345","sessionId":"<uuid>"}
{"type":"agent-name","agentName":"Custom - 12345","sessionId":"<uuid>"}
Hook output verified via stdin/stdout logging — the hook emits the correct JSON every time. Records reach the JSONL. Terminal tab title and /resume picker both display "Custom - 12345" correctly. Only the VSCode sidebar shows the ai-title until the session is reopened.
Related Issues
- #53023 (Desktop, closed as duplicate) — same bug pattern: "Live session title refresh when hook returns hookSpecificOutput.sessionTitle"
- #55951 (Desktop, open) — same bug pattern: "Desktop sidebar ignores UserPromptSubmit hook sessionTitle output"
- #11145 (VSCode, open) — related feature request for manual tab rename in VSCode
Question
Is there a documented setting to disable ai-title generation entirely? If so, it would serve as a workaround.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗