Feature: Programmatic session/thread renaming via hooks or tools
Open 💬 6 comments Opened Mar 28, 2026 by stevestencil
Summary
Add the ability to programmatically rename a Claude Code session/thread mid-conversation via a hook event or tool, rather than requiring manual /rename input.
Use Case
When working with GitHub issues and PRs, I want the session name to automatically reflect what I'm working on:
- Start work on an issue → session name becomes
#42 - Fix auth bug - Create a PR from that work → session name changes to
PR #123 - Fix auth bug
This enables at-a-glance tracking of which conversation maps to which issue/PR, especially when juggling multiple sessions.
Current Behavior
claude -n "name"sets the name at startup (manual, one-time)/renamechanges the name mid-session (manual, interactive-only)- Hooks (e.g., SessionStart) cannot modify session metadata
- No tool or API exists to set the session name programmatically
Proposed Solutions (any of these would work)
- New hook event — e.g.,
RenameSessionthat allows hooks or tools to set the session name - Scriptable
/rename— allow/renameto be called from within tool execution or hook scripts - New built-in tool — a
SetSessionNametool that Claude can call during a conversation (e.g., after creating a PR viagh pr create)
Example Workflow
User: Work on issue #42
Claude: [reads issue, starts work, sets session name to "#42 - Fix auth bug"]
... development happens ...
Claude: [creates PR #123, sets session name to "PR #123 - Fix auth bug"]
Environment
- Claude Code CLI + Desktop App
- macOS
This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗