Sync session name (/rename) with terminal tab title
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 working with multiple Claude Code sessions in different terminal tabs, it's difficult to identify which tab corresponds to which session.
Currently, after using /rename my-project to name a session, the terminal tab title remains unchanged, showing generic names like "claude" or "node" instead of the session name.
This makes it hard to quickly switch between different project contexts when multitasking.
Proposed Solution
When using /rename session-name, Claude Code should automatically update the terminal tab title to reflect the session name.
Implementation suggestion:
Use ANSI escape sequences to update the terminal title:
\033]0;session-name\007
This works across most terminal emulators (Terminal.app, iTerm2, Warp, Hyper, etc.).
Optional enhancements:
- A setting to enable/disable this behavior (e.g.,
terminal.syncTitle: true) - - Format option like
"Claude: {session-name}"or just"{session-name}"
Alternative Solutions
Currently, I work around this by manually setting the terminal title before launching Claude Code using shell functions:
title() { echo -ne "\033]0;$1\007"; }
title "my-project" && claude
This is cumbersome because it requires manual intervention every time and doesn't sync when using /rename within a session.
Priority
Medium - Would be very helpful
Feature Category
CLI commands and flags
Use Case Example
- I have 5 terminal tabs open, each with a Claude Code session for different projects
- 2. I use
/rename auth-refactorin one session and/rename payment-integrationin another - 3. When I need to switch contexts, I look at my terminal tabs but they all show "claude" or "node"
- 4. I have to click through each tab to find the right project
- 5. With this feature, I could instantly identify each session by its name in the tab title
Additional Context
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗