Feature: Allow programmatic session rename from skills/commands

Open 💬 9 comments Opened Mar 14, 2026 by bradfeld

Problem

The /rename command (added in v2.1.76) is a great feature for naming sessions, but it cannot be automated within custom workflows. This creates friction for users who have slash commands that already have the perfect session name available programmatically.

Concrete use case: I have a /start TICKET-XXX command that fetches a Linear ticket title, creates a feature branch, and begins work. At Step 4, it already has the ticket ID and title (e.g., "IOS-21: Build new platform app command"). This is the ideal session name — but there is no way to set it automatically.

Current limitations

| Method | Limitation |
|--------|-----------|
| /rename "name" | Interactive only — AI cannot invoke built-in commands |
| claude -n "name" | Requires knowing the name before session start |
| Hooks | Receive session_id but explicitly cannot rename sessions |
| Bash tool | No claude session rename CLI subcommand exists |

Proposed solution (any of these would work)

  1. AI-accessible tool — A SessionRename tool that the AI can call from within skills/commands, similar to how TaskCreate/TaskUpdate work for task management.
  1. Hook capability — Allow hooks to rename the session. Hooks already receive session_id in their input JSON; adding a rename capability via stdout or a response field would be natural.
  1. CLI subcommandclaude session rename <session-id> <name> callable from Bash, with the session ID available via environment variable (e.g., $CLAUDE_SESSION_ID).

Option 1 is the most ergonomic — it would let any custom command set a meaningful session name as part of its workflow.

Impact

This would make /resume significantly more useful for power users who work across many tickets/sessions. Currently, sessions show up as unnamed entries; with automation, every /start session would be instantly identifiable by ticket ID and title.

View original on GitHub ↗

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