Feature: allow a hook or the model to set the session title

Open 💬 0 comments Opened Jun 26, 2026 by esempe

Problem

There is no way for the model or a hook to set the session title. /rename is a user-only slash command, and the model has no tool to invoke it. A SessionStart hook can inject additionalContext (so the model can prefix its reply text), but nothing a hook returns changes the actual session title shown in the UI / session list.

Requested

Any one of:

  1. A SessionStart (and/or UserPromptSubmit) hook output field that sets/overrides the session title, e.g. hookSpecificOutput.sessionTitle.
  2. A model-callable tool to rename the current session (analogous to mark_chapter, which today only adds transcript chapters, not a title).
  3. Honoring a programmatic /rename equivalent.

Why

Useful for auto-tagging sessions based on context (e.g. working directory) so they're identifiable at a glance in the session list — a SessionStart hook can compute the tag but can only put it in the message body, not the title.

Environment

Claude Code (desktop). Model: Opus 4.8.

View original on GitHub ↗