Allow slash commands / hooks to set the session name (or seed the input buffer)
Type: Feature request
Problem
Sessions are auto-named from an early snapshot of the conversation. For sessions that move through several topics, the resume-picker label reflects whatever the session opened with (often the first command or a pasted URL), not the substantive work. The result is a resume list where names don't describe what actually happened in each session.
/rename fixes this manually, but it's a user-facing interactive command with no programmatic entry point. That leaves no way to close the loop from tooling that already understands the full session.
Concrete use case
I have a custom /session-log command that runs at the end of a working session and summarises the entire conversation into my notes. It's ideally placed to produce an accurate, full-session name, but it can only print a suggested /rename <name> line for me to copy-paste. It can't apply the name, and it can't seed the input box so I could accept it with →/Enter.
Requested (in priority order)
- A programmatic way to set the current session's name — e.g. a hook output field (
sessionName) onStop/SessionEnd, or a documented non-interactive form of/rename. This fully solves the use case. - Failing that, a way to seed the input buffer with suggested text (committed or as an accept-with-→ ghost suggestion) from a command or hook. This would let tooling propose
/rename <name>for one-keystroke acceptance.
Why it matters
Session names are the primary wayfinding mechanism in --resume. Letting end-of-session tooling name sessions accurately makes resume genuinely useful for people who run many sessions a day.
Current behaviour verified against docs (2026-07-10)
No hook output writes to the input buffer or session name; --prompt-suggestions is print-mode only; ghost-text suggestions are auto-generated and not controllable.