Feature request: SessionRename hook event to allow terminal tab renaming
Feature Request
Problem
When using /rename to rename a Claude Code session, the terminal tab title remains unchanged. With multiple sessions open, all tabs show the same default name (e.g., 2.1.77 my-project), making it hard to distinguish between them.
Proposed Solution
Add a SessionRename hook event that fires when /rename is used. This would allow users to configure a hook that updates the terminal tab title to match the session name.
Example hook configuration in settings.json:
{
"hooks": {
"SessionRename": [
{
"command": "printf '\\033]0;${SESSION_NAME}\\007'"
}
]
}
}
The hook should receive the new session name as an environment variable (e.g., SESSION_NAME or CLAUDE_SESSION_NAME).
Use Case
When working with multiple Claude Code sessions in parallel (e.g., different feature branches or tasks), being able to visually distinguish terminal tabs by session name greatly improves workflow. Currently all tabs look identical:
2.1.77 my-project2.1.77 my-project2.1.77 my-project
With this hook, after /rename "investigating bug #123", the terminal tab would also update to reflect that name.
Alternatives Considered
- Manually running
printf '\033]0;name\007'after each rename — works but defeats the purpose of a quick/rename - Using
UserPromptSubmithook — too broad, fires on every prompt, not just renames
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗