Feature request: Allow Claude to programmatically rename sessions

Open 💬 11 comments Opened Feb 27, 2026 by emerson-d-lopes

Summary

Allow Claude to automatically rename the current session when a user mentions or shares a ticket ID (e.g., TICKET-123). Today, session naming is manual-only via /rename, and there's no tool or hook that can trigger a rename programmatically.

Use Case

When working on a Linear ticket, I often mention or paste the ticket ID in conversation. I'd like Claude to automatically set the session name to that ticket ID so I can easily find and resume it later.

Currently, I have to manually run /rename TICKET-123 every time, which breaks flow.

Proposed Solution

One of:

  1. A built-in tool (e.g., SessionRename) that Claude can call to rename the current session when contextually appropriate (e.g., when a ticket ID is mentioned).
  2. A hook event that fires when a session name could be inferred, allowing custom logic to set it.
  3. A --name CLI flag for setting the session name at launch, combined with an in-session tool for dynamic renaming.

The ideal behavior: when I say "I'm working on TICKET-123" or paste a ticket URL, Claude detects the ticket ID and renames the session automatically — no manual /rename needed.

Current Workarounds

  • Manual /rename after every session start
  • Shell wrapper functions that inject context via --append-system-prompt, but still can't rename
  • Worktree naming provides some discoverability but isn't a session name

View original on GitHub ↗

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