Programmatic Chat Title / Rename via Hooks

Feature request for product/service

Chat

Describe the request

Summary

Add a title (or chat_title) output field to the stop hook so that agents and hook scripts can set the chat’s sidebar title at the end of a session.

Problem

Cursor auto-generates a chat title from the first message, which tends to produce generic names like “Can you help me with…” rather than something meaningful like “PRD-043 — Report Theming QA Fixes”.

Power users who work on named tickets, PRDs, bugs, or features across many chats end up renaming each one manually after the session ends. This is friction that Cursor already has all the information to eliminate — the agent knows exactly what it worked on.

Proposed Solution

Allow the stop hook (which already fires on agent completion) to return an optional title field:

{
“title”: “PRD-043 — Report Theming QA Fixes”
}

Cursor would apply this as the chat’s sidebar title, replacing the auto-generated one.

Why the stop hook is the right place

It fires once, at the end of the session, when the full context is available

It already supports followup_message for continuing a workflow, so the pattern of the hook influencing the chat state is already established

A hook script can inspect the transcript to infer the right title deterministically (e.g. by scanning for file paths matching a project’s naming conventions)

Alternative: a rename slash command or CLI subcommand

If modifying the hook protocol is complex, a simpler alternative would be a slash command like /rename that the agent (or the user) can invoke during the session to set the title, or a CLI subcommand:

cursor agent rename <conversation_id> “PRD-043 — Report Theming QA Fixes”

Use Cases
Ticket-based development — auto-name a chat after the Jira/Linear ticket being worked on
PRD authoring — auto-name after the PRD file opened during the session
Bug investigations — auto-name after the bug number inferred from files accessed
Weekly planning sessions — auto-name after the week (e.g. “2026-W17 Weekly Planning”)

Current workaround

A stop hook can return a followup_message that instructs the agent to print the suggested title at the end of its response. The user then copies it and renames manually. This works but is a two-step process that requires user action and leaves a noisy message in the chat.

Requested change (minimal scope)

Add title?: string to the stop hook’s output schema. If present and non-empty, Cursor sets the chat sidebar title to the provided value.

That’s it. No new events, no new CLI commands needed — just one optional field in an existing hook.

//

First time posting, hope that’s okay :slight_smile: Open to comments/ suggestions.

Thanks!

Operating System (if it applies)

MacOS