Auto-rename sessions on exit

Resolved 💬 4 comments Opened Feb 13, 2026 by jonathanlaniado Closed Mar 14, 2026

Feature request

Now that /rename auto-generates a session name from conversation context when called without arguments, it would be useful to have an option to automatically trigger this on session exit.

Problem

Sessions accumulate with generic names (first prompt text), making it hard to find past conversations in the session picker. The new /rename auto-generate feature solves this well, but it requires remembering to run it manually before closing each session.

Proposed solution

One or both of:

  1. A setting like autoRenameOnExit: true that automatically generates a session name from conversation context when a session ends.
  2. A PreSessionEnd hook event that fires before session teardown and can invoke commands — enabling users to wire up /rename (or other cleanup) themselves.

Why not use existing hooks?

  • SessionEnd fires after the session is already terminating and is designed for fire-and-forget cleanup — it can't modify session state.
  • Stop fires when Claude finishes responding, not on session exit, and can't invoke slash commands.
  • There's no hook that runs before session teardown with the ability to affect session metadata.

Context

The auto-generate /rename (no arguments) shipped recently per the CHANGELOG. This request is a natural extension of that UX improvement.

View original on GitHub ↗

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