claude-code - 💡(How to fix) Fix Feature request: Programmatic API for session title + locale-aware AI title generation [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#58573Fetched 2026-05-14 03:44:47
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Author
Timeline (top)
labeled ×4commented ×1

Two related gaps in the current Claude Code VS Code extension that, together, prevent automating chat session titles in the user's preferred language:

  1. No programmatic way to update a session title — neither via vscode.commands.executeCommand, an exposed extension API, nor an external CLI hook.
  2. AI-generated titles are always in English — even when the entire conversation (and CLAUDE.md) is in another language (Korean, in my case), and there is no user-level setting to override the language.

There's also no user-visible UI to manually rename a chat tab (✏️-style click does not enter an edit state in v2.1.140), which compounds the issue.

Root Cause

I tried building a Stop hook that calls claude -p --model sonnet to summarize the recent messages into a short Korean title, then appends it to the JSONL. The hook works (Sonnet produces good Korean titles), but the chat header never reflects them because:

Fix Action

Fix / Workaround

Happy to provide more details / test patches.

Code Example

"claude-vscode.renameSession": { "sessionId": "...", "title": "..." }
RAW_BUFFERClick to expand / collapse

Feature request: Programmatic API for session title + locale-aware AI title generation

Repository: https://github.com/anthropics/claude-code

Summary

Two related gaps in the current Claude Code VS Code extension that, together, prevent automating chat session titles in the user's preferred language:

  1. No programmatic way to update a session title — neither via vscode.commands.executeCommand, an exposed extension API, nor an external CLI hook.
  2. AI-generated titles are always in English — even when the entire conversation (and CLAUDE.md) is in another language (Korean, in my case), and there is no user-level setting to override the language.

There's also no user-visible UI to manually rename a chat tab (✏️-style click does not enter an edit state in v2.1.140), which compounds the issue.

Current behavior (v2.1.140)

  • Session titles are auto-generated via a generate_session_title API call. Output is consistently in English.
  • The title is stored in the session JSONL as an ai-title event.
  • Editing the JSONL directly (appending a new ai-title event) does NOT update the chat header until a full window reload — the extension does not watch the JSONL with fs.watch / createFileSystemWatcher.
  • The rename_session, rename_tab, update_session_state message handlers exist internally but are only reachable from the webview <-> extension IPC, not from vscode.commands.executeCommand or any other external entry point.
  • Attempted Chrome DevTools Protocol (--remote-debugging-port) attach: VS Code's production Electron build does not expose the webview frame for HTTP CDP, so external Runtime.evaluate to call acquireVsCodeApi().postMessage({type: "rename_session", ...}) is not possible.

Why this matters / use case

I run Claude Code in Korean. My CLAUDE.md explicitly instructs Korean responses, and every user message is Korean. Despite this, every new chat tab gets an English title like "Check Notion connection status", which makes the tab list hard to scan in a Korean workflow.

I tried building a Stop hook that calls claude -p --model sonnet to summarize the recent messages into a short Korean title, then appends it to the JSONL. The hook works (Sonnet produces good Korean titles), but the chat header never reflects them because:

  • The extension does not watch the JSONL file.
  • There is no vscode.commands.executeCommand entry point to programmatically trigger rename_session.
  • CDP webview attach is blocked by the production build.

Proposed solutions (any of these would resolve it)

Option A — Locale-aware title generation

A user setting like claudeCode.titleLanguage (or just respect CLAUDE.md-level language directives in the title-generation prompt). Lowest user-side friction.

Option B — Public command for renaming

Register a command such as:

"claude-vscode.renameSession": { "sessionId": "...", "title": "..." }

so that external tooling and Stop hooks can call it via vscode.commands.executeCommand (or via the standard vscode:// URL handler).

Option C — JSONL file watcher

Have the extension watch the active session JSONL with vscode.workspace.createFileSystemWatcher, so external ai-title event appends are reflected without a window reload.

Option D — User-facing rename UI

A click-to-edit on the chat tab header (the small ✏️ icon already shown in the header would be a natural target).

Environment

  • Claude Code extension: anthropic.claude-code-2.1.140 (win32-x64)
  • VS Code: 1.119.1 (WSL Remote)
  • OS: Windows 11 + WSL2 (Ubuntu)
  • Workflow: 100% Korean

Happy to provide more details / test patches.

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