[FEATURE] Propagate session name to terminal title via escape sequences when using `/rename`

Resolved 💬 5 comments Opened Apr 6, 2026 by mattwilkinsonn Closed May 28, 2026

This is a copy of #18326, which was locked due to no activity. the suggested workaround there (claude auto-updating the terminal name) never works for me, and regardless the rename should work on /rename.

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

When using /rename to name a Claude Code session, the name is only visible within Claude Code itself. When running multiple Claude Code sessions in VS Code's terminal panel, all the tabs look identical.

Pain points:

  • Multiple Claude Code terminals are indistinguishable in VS Code's tab bar
  • You have to click into each terminal to figure out which session it is
  • VS Code allows custom terminal tab naming, but once set, it becomes static and won't update with subsequent /rename calls

Proposed Solution

When /rename <name> is called, Claude Code should emit terminal escape sequences to set the terminal title. This would enable:

  1. VS Code terminal title integration — VS Code can be configured (via terminal.integrated.tabs.title and related settings) to display the terminal's sequence-based title
  2. Native terminal support — Most terminals (iTerm2, Windows Terminal, etc.) also respect these sequences
  3. Bidirectional benefit — Improves UX at both the CLI level (session management) and the editor level (tab management)

Relevant escape sequences:

# Set terminal title (OSC 2)
\033]2;Claude: <session-name>\007

# Set icon name and title (OSC 0)  
\033]0;Claude: <session-name>\007

Ideal behavior:

  • /rename my-feature → terminal title becomes "Claude: my-feature"
  • Title persists for the session duration
  • On session resume, title is restored automatically

Alternative Solutions

Current workarounds:

  • Manually renaming VS Code terminal tabs (doesn't sync with Claude Code session name, becomes static)
  • Using separate terminal windows instead of tabs
  • Clicking through terminals to identify sessions

Competing tools:

  • tmux sessions automatically show in the terminal title
  • SSH connections typically set terminal titles to include host info

Priority

Medium - Would be very helpful

Feature Category

CLI commands and flags

Use Case Example

  1. Developer opens VS Code with a project
  2. Runs Claude Code in terminal 1, does /rename drops-animation
  3. Opens terminal 2 for Claude Code, does /rename journey-api
  4. Opens terminal 3 for Claude Code, does /rename debugging
  5. Currently: All three tabs show "claude" or similar generic name
  6. With feature: Tabs show "Claude: drops-animation", "Claude: journey-api", "Claude: debugging"
  7. Developer can now visually jump to the right context without clicking through

Additional Context

VS Code settings that would leverage this:

{
  "terminal.integrated.tabs.title": "${sequence}",
  "terminal.integrated.tabs.description": "${task}${separator}${local}"
}

Technical reference: ANSI escape codes - OSC sequences_sequences)

View original on GitHub ↗

This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗