Feature: Allow hooks to set session name/title

Resolved 💬 3 comments Opened Apr 1, 2026 by thedug Closed Apr 5, 2026

Problem

There's no way to programmatically set or rename a session's title via the hooks system. The SessionStart hook fires at exactly the right time (startup, resume, clear, compact), but hook output can only inject context text -- it can't modify session metadata.

Use Case

In multi-agent setups where a root CLAUDE.md routes to different agent personas based on user input, it would be useful to prefix session names with the active agent. For example:

  • Morgan: weekly brief triage
  • Sloane: hook system research
  • Nate: pipeline review

This makes it much easier to find and resume sessions when you have dozens of them across different agent contexts.

Proposed Solution

Allow SessionStart hook output to include a session_name field (or similar) that sets or prefixes the session title:

{
  "hookSpecificOutput": {
    "hookEventName": "SessionStart",
    "sessionName": "Sloane: hook system research"
  }
}

Alternatively, a sessionNamePrefix field that prepends to whatever name the user provides or is auto-generated would also work well.

Alternatives Considered

  • Manually renaming sessions -- doesn't scale when switching agents frequently
  • Injecting context via hook stdout -- helps Claude know the agent, but doesn't help the human scanning a session list
  • Scripting against session storage directly -- fragile, undocumented internals

View original on GitHub ↗

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