[FEATURE] Honor hookSpecificOutput.sessionTitle from PostToolUse/Stop hooks (mid-turn session rename)
Type: Feature request
Version: 2.1.236, macOS (darwin)
Problem
hookSpecificOutput.sessionTitle is only honored from UserPromptSubmit (and SessionStart). When a session's real subject only becomes known mid-turn, there is no supported way to update the displayed session title until the user's next typed prompt.
Concrete use case: a /review-pr skill invoked with no arguments lists PRs pending review and lets the user pick one from an AskUserQuestion menu. At selection time the session's proper title (review-pr-<number>-<slug>) is finally known — but the selection is a tool result, not a prompt, so no UserPromptSubmit fires. The skill can rename the tmux window immediately via its own tooling, yet the CC UI session title stays stale until the next real prompt, which in a long review flow can be many minutes later.
What I verified empirically (2.1.236)
Using project-scoped test hooks emitting byte-identical output shapes:
UserPromptSubmitreturning{"hookSpecificOutput": {"hookEventName": "UserPromptSubmit", "sessionTitle": "..."}}→ title applied and recorded as acustom-titletranscript entry (control, proving the detection method works — including in headless-pruns)PostToolUsereturning the same shape (withhookEventName: "PostToolUse") → silently ignored, no error, no transcript entryStopreturning the same shape → silently ignored
Also: appending a custom-title entry to the transcript externally is picked up by anything tailing the file, but CC never re-reads titles from disk, so its in-memory/displayed title is unaffected.
Request
Honor sessionTitle in hookSpecificOutput from PostToolUse (ideal for this case — it fires the moment the skill's rename command completes) and Stop. Alternatively (or additionally), document any other supported programmatic way to retitle a live session mid-turn.
Silent acceptance of the field with no effect is the worst of both worlds — if an event doesn't support sessionTitle, a warning in claude --debug output would also help.
Related
- #76354 (programmatic session naming from slash commands / Stop hooks)
- #69411 (expose auto-generated title to hooks for prefix/suffix wrapping)
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗