Auto-name sessions after N prompts based on conversation topic

Resolved 💬 4 comments Opened Mar 27, 2026 by glouie Closed Mar 31, 2026

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:

  1. Interrupt their flow to think of a name
  2. Remember to do it early enough to be useful
  3. 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, /resume picker, and IDE sidebar
  • User can override with /rename at any time

Option B: Hook-based naming

  • Expose a RenameSession hook event or a session.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_name in hook fields)

Option C: Prompt-count trigger + /rename

  • After N prompts, Claude proactively calls /rename with 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

  1. 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.
  1. 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."
  1. Resume after break — Coming back to /resume with 10+ sessions. Auto-names let you find the right one instantly instead of trial-and-error.
  1. 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_name to hooks common fields (infrastructure for hook-based naming)
  • #35378 — Make /rename settable via --name flag or hooks (API surface)
  • #39532 — --name flag 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 /rename every 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

View original on GitHub ↗

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