claude-code - 💡(How to fix) Fix [BUG] VSCode sidebar displays ai-title instead of custom-title during live session despite UserPromptSubmit hook setting custom title [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#56014Fetched 2026-05-05 06:00:27
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Timeline (top)
labeled ×5commented ×1

Error Message

Error Messages/Logs

Fix Action

Fix / Workaround

Is there a documented setting to disable ai-title generation entirely? If so, it would serve as a workaround.

Code Example



---

{
     "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'"
         }]
       }]
     }
   }

---

{"type":"ai-title","sessionId":"<uuid>","aiTitle":"Foo implementation"}
{"type":"custom-title","customTitle":"Custom - 12345","sessionId":"<uuid>"}
{"type":"agent-name","agentName":"Custom - 12345","sessionId":"<uuid>"}
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • 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

  1. Add a UserPromptSubmit hook to ~/.claude/settings.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'"
          }]
        }]
      }
    }
  2. Open a fresh session in the VSCode extension.

  3. Submit a prompt matching the pattern (e.g. /foo 12345 do something).

  4. Observe the sidebar title: it shows the auto-generated ai-title (e.g. "Foo something implementation"), not "Custom - 12345".

  5. 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.

extent analysis

TL;DR

The VSCode extension sidebar may need an update to its live-update logic to prioritize custom titles over auto-generated ai-titles during live sessions.

Guidance

  • Investigate the live-update path in the VSCode extension to ensure it respects custom-title priority, similar to the cold-load path.
  • Review related issues (#53023, #55951) for potential shared logic or fixes that could apply to the VSCode extension.
  • Check if there's a setting or configuration option to disable ai-title generation, which could serve as a temporary workaround.
  • Verify that the hook output and JSONL records are correctly updated and propagated to the VSCode extension.

Example

No code snippet is provided as the issue seems to be related to the extension's logic rather than a specific code error.

Notes

The issue appears to be specific to the VSCode extension and its handling of live session updates. The fact that closing and reopening the session resolves the issue suggests a potential caching or update mechanism that needs to be addressed.

Recommendation

Apply a workaround by investigating the possibility of disabling ai-title generation entirely, if such a setting exists, until a permanent fix can be implemented for the live-update logic.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING