[FEATURE] Auto-name session on exit if unnamed, and surface the name to the user

Resolved 💬 2 comments Opened Apr 9, 2026 by timcondit Closed Apr 9, 2026

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 a session ends without a name, it becomes hard to find in the session picker — you're left scanning timestamps with no context clue. The /rename command requires you to remember to run it mid-session, before you've lost context on what the session was about.

Proposed Solution

When a session ends (via /exit or similar clean exit) and has no user-assigned name, automatically generate a name from the conversation content — the same inference already used by /rename with no argument — and display it before closing:

  • Session saved as: "claude-code-session-resume"
  • Resume with: claude --resume claude-code-session-resume

This gives the user a persistent, meaningful handle without any extra steps.

Alternative Solutions

  • /rename mid-session works but requires remembering to do it before context fades
  • /rename with no argument generates a good name on demand, but only if you remember to run it
  • Naming at startup (claude -n "name") requires knowing the topic before you've explored it

Priority

Medium - Would be very helpful

Feature Category

Interactive mode (TUI)

Use Case Example

This is especially useful for workflows involving frequent context-switching across multiple sessions or domains, where low overhead session recovery is important.

Additional Context

The auto-generated name from /rename (no args) is already context-aware and works well. The only missing piece is surfacing this automatically at the end of unnamed sessions, and printing the resume command so users can immediately note it if needed.

---

This _may_ be related to #39866.

View original on GitHub ↗

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