Feature request: expose a session-rename tool to the agent (like Codex's set_thread_title)

Status Open
Maintainer reply None cached
Activity 1 comment · opened Sep 12, 2026

Summary

There is currently no way for the running agent (or a hook) to programmatically rename/set the title of a Claude Code desktop session. Renaming is only possible via the user-driven /rename <name> command, Ctrl+R in the session picker, or -n/--name at launch time.

Motivation

I run several long-lived, concurrently-open Claude Code desktop sessions against a ticket-tracking system (each session works a ticket end-to-end). Desktop session titles are currently auto-generated (e.g. "T856 investigation") and don't reflect which model/project/ticket is active, which makes it hard to tell sessions apart in the sidebar at a glance.

I wanted a hook (fired when a ticket transitions to "doing") to compute a name like SON_BUS_T1000 (model prefix + project + ticket number) and set it as the session's display title automatically.

I confirmed there is no supported mechanism for this today:

  • Hook JSON output only supports permissionDecision, systemMessage, terminalSequence (raw terminal escape codes — affects a terminal tab title, not the desktop session list), updatedInput, retry. None of these set the desktop session's display name.
  • claude --help has no subcommand to rename a running session.
  • No MCP/tool in the agent's own toolset exposes this capability.

Prior art

OpenAI's Codex app exposes exactly this to its own agent as an internal control-plane MCP tool: mcp__codex_app__set_thread_title, callable with {"title": "..."}. It's described as "a Codex app control API, not a public OpenAI Platform API endpoint" — i.e. an app-internal tool for the agent to manage its own UI presentation.

Request

Expose an equivalent capability in Claude Code / the Claude Agent SDK, e.g.:

  • A tool available to the running agent (something like set_session_title) that updates the current session's displayed name in the desktop app's session list.
  • And/or a new hook output field (e.g. sessionTitle) that a hook (UserPromptSubmit, Stop, PreToolUse, etc.) can set to rename the current session.

Either surface would let an agent or a hook keep the session list meaningfully labeled during long-running, multi-session workflows, without requiring the human to manually run /rename every time.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗