Auto-name sessions after N prompts based on conversation topic
Preflight Checklist
- [x] I have searched existing requests and while related issues exist (#32434, #39866, #39456), this specific feature (automatic topic-based naming triggered after N prompts) hasn't been requested
- [x] This is a single feature request (not multiple features)
Problem Statement
When running multiple concurrent Claude Code sessions (e.g., parallel worktrees, background agents, different feature branches), it's nearly impossible to tell sessions apart. The /resume picker shows generic timestamp-based entries, and terminal tabs show identical "claude" titles.
The manual /rename command exists but requires the user to:
- Interrupt their flow to think of a name
- Remember to do it early enough to be useful
- Do it for every session, every time
In practice, nobody does this consistently. The result: a list of anonymous sessions that you have to open and inspect to identify.
Proposed Solution
Auto-name sessions after N prompts (configurable, default ~3) by inferring the conversation topic from the first few exchanges:
Prompt 1: "review my deck at ~/project/presentation.pptx"
Prompt 2: "fix the text clipping on slides 3 and 6"
Prompt 3: "now run the visual audit"
→ Auto-name: "powerpoint deck visual audit"
Implementation options (any of these would solve it):
Option A: Built-in auto-naming (preferred)
- After N tool uses or prompts (configurable), Claude infers a short topic name (3-6 words) and sets it as the session name
- Displayed in TUI prompt line, terminal tab title,
/resumepicker, and IDE sidebar - User can override with
/renameat any time
Option B: Hook-based naming
- Expose a
RenameSessionhook event or asession.rename(name)API that hooks/skills can call - Create a built-in or example hook that fires after N prompts and calls the LLM to generate a name
- This leverages the existing hook system (#39456 requests
session_namein hook fields)
Option C: Prompt-count trigger + /rename
- After N prompts, Claude proactively calls
/renamewith an inferred topic - Lightweight: no new API needed, just a behavioral change
Naming quality heuristics
Good auto-names are:
- 3-6 words, lowercase
- Derived from the task, not the files (e.g., "auth middleware refactor" not "editing src/auth.ts")
- Stable — once set, the name shouldn't change unless the conversation topic shifts significantly
- Unique within the project — if two sessions are both "test fixes", append a differentiator
Use Cases
- Parallel worktree development — 3 terminals, each on a different feature branch. Auto-names would show "powerpoint-review plugin", "tui widget tests", "confluence integration" instead of three identical "claude" tabs.
- Background agents — Dispatching agents that run in background. When they complete, the notification says "Session abc123 completed" — an auto-name would say "visual audit agent completed."
- Resume after break — Coming back to
/resumewith 10+ sessions. Auto-names let you find the right one instantly instead of trial-and-error.
- IDE multi-session — VS Code sidebar shows multiple sessions. Names make them navigable.
Related Issues
- #32434 — Auto-name during plan mode (narrower scope, plan-only)
- #39866 — Better session names in /resume (UX improvement, no auto mechanism)
- #39456 — Add
session_nameto hooks common fields (infrastructure for hook-based naming) - #35378 — Make
/renamesettable via--nameflag or hooks (API surface) - #39532 —
--nameflag should set display name (bug/gap in existing naming)
This request unifies these into a single coherent feature: sessions should auto-name themselves based on what's happening in them.
Alternative Solutions
- Manual
/renameevery session (current state — nobody does this consistently) - External tooling to parse JSONL session files and build an index (fragile, out-of-band)
- Status line customization (#31361) to show topic — helpful but doesn't persist across resume
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗