claude-code - 💡(How to fix) Fix Feature: Allow AI to programmatically update session name (sync UI display) [3 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#48113Fetched 2026-04-15 06:32:49
View on GitHub
Comments
3
Participants
2
Timeline
7
Reactions
0
Author
Timeline (top)
commented ×3labeled ×3closed ×1

Currently, the session name displayed in Claude Code's input area (top-right UI element) can only be updated via the /rename slash command, which must be typed by the user. There is no way for the AI assistant to trigger a session rename programmatically.

Root Cause

Currently, the session name displayed in Claude Code's input area (top-right UI element) can only be updated via the /rename slash command, which must be typed by the user. There is no way for the AI assistant to trigger a session rename programmatically.

Fix Action

Fix / Workaround

When a user asks the AI to rename the current session, the AI can update file-based workarounds (e.g. a session-name-override file used by custom status line scripts), but cannot update the session name shown in Claude Code's own UI — the top-right label in the input area.

Users who want the AI to auto-name sessions based on conversation content (e.g. via a UserPromptSubmit hook) currently need a two-step workaround:

  • AI updates a custom override file → status line reflects new name
  • User must still manually run /rename → Claude Code UI reflects new name
RAW_BUFFERClick to expand / collapse

Summary

Currently, the session name displayed in Claude Code's input area (top-right UI element) can only be updated via the /rename slash command, which must be typed by the user. There is no way for the AI assistant to trigger a session rename programmatically.

Problem

When a user asks the AI to rename the current session, the AI can update file-based workarounds (e.g. a session-name-override file used by custom status line scripts), but cannot update the session name shown in Claude Code's own UI — the top-right label in the input area.

The user must still manually type /rename <name> to update the UI, even after the AI has already determined an appropriate name.

Proposed Solution

One or more of the following:

  1. Expose a tool or hook that allows the AI to call /rename programmatically (e.g. a RenameSession tool similar to existing tools like TaskCreate).
  2. Have Claude Code watch the sessions JSON file (~/.claude/sessions/<pid>.json) for changes to the name field and reflect them in the UI without requiring an in-memory update via /rename.
  3. Provide a documented IPC mechanism (e.g. via hs.ipc or a named pipe) so external scripts or the AI can signal Claude Code to refresh the session name from disk.

Use Case

Users who want the AI to auto-name sessions based on conversation content (e.g. via a UserPromptSubmit hook) currently need a two-step workaround:

  • AI updates a custom override file → status line reflects new name
  • User must still manually run /rename → Claude Code UI reflects new name

A unified mechanism would allow full automation of session naming without user intervention.

Environment

  • Claude Code: 2.1.107
  • macOS: 15.7.4 (Sequoia, Apple Silicon)
  • Terminal: iTerm2 3.6.9

🤖 Generated with Claude Code

extent analysis

TL;DR

Implementing a programmatic way for the AI to update the session name in Claude Code's UI, such as exposing a RenameSession tool or watching the sessions JSON file for changes, would resolve the issue.

Guidance

  • Consider exposing a RenameSession tool similar to existing tools like TaskCreate to allow the AI to call /rename programmatically.
  • Alternatively, have Claude Code watch the sessions JSON file for changes to the name field and reflect them in the UI without requiring an in-memory update via /rename.
  • Evaluate the feasibility of providing a documented IPC mechanism to allow external scripts or the AI to signal Claude Code to refresh the session name from disk.
  • Assess the potential impact of such changes on the existing workflow and user experience.

Example

No code snippet is provided as the issue does not contain sufficient technical details to generate a specific example.

Notes

The proposed solutions require modifications to Claude Code's internal mechanisms or API, which may involve significant development and testing efforts. The choice of solution depends on the specific requirements and constraints of the project.

Recommendation

Apply a workaround by exposing a RenameSession tool or watching the sessions JSON file for changes, as these approaches seem to be the most straightforward and least invasive solutions.

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

claude-code - 💡(How to fix) Fix Feature: Allow AI to programmatically update session name (sync UI display) [3 comments, 2 participants]