Auto-rename sessions based on conversation context
Problem
When working across multiple Claude Code sessions in separate terminal tabs (e.g., iTerm2), it's difficult to identify which tab contains which work. The only way to distinguish sessions is by manually running /name, which breaks flow and is easy to forget.
The current session identifier is a UUID, which provides no context at a glance.
Proposed solution
Automatically generate a short, descriptive session name based on the conversation context. This could work as:
- Auto-name on first substantive interaction — after the first tool call or user message, generate a name like
"symfony-upgrade-debugging"or"fix-auth-middleware". - Re-rename mid-flight — as the conversation evolves, update the name if the focus shifts significantly (e.g., from debugging to refactoring).
Possible implementation approaches
- LLM-generated name: Use a lightweight model call (e.g., Haiku) to summarize the session topic into 2-4 words after the first few exchanges.
- Heuristic-based: Derive a name from the first file edited, branch name, or slash command used.
- Hook-based: Expose an
on_session_startoron_context_changehook, plus aSessionRenametool, so users can implement custom naming logic via skills or hooks.
Configuration
- A setting to opt in/out (e.g.,
"autoNameSessions": truein settings) - Respect manually set names — don't overwrite a name the user set with
/name
Use case
A typical workflow involves 3-5 concurrent Claude Code sessions in iTerm tabs — one per feature branch or task. Today, the only way to find the right tab is to switch to each one and read the conversation. Auto-generated descriptive names would make tab-switching instant, especially with iTerm's tab title display.
Alternatives considered
- Manual
/name: Works but requires discipline and interrupts flow. - Custom skill: Skills cannot programmatically rename sessions — there's no
SessionRenametool or equivalent API available to them.
This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗