[FEATURE] Programmatic session rename API for skills/agents
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
Summary
Claude Code currently has no agent-callable mechanism to rename the current session.
Only the user can run /rename. This blocks skill/agent flows that want to reflect
work context (e.g. a Jira issue key) in the session title automatically.
Use case
Our team has a skill (isv-start) that:
- Verifies/creates a Jira ticket
- Creates a matching git branch (e.g.
isv/1234) - Wants to rename the session to
ISV-1234so the sidebar/tab matches the work
The skill's bash script emits a marker like <<RENAME-SESSION KEY=ISV-1234>> and the
SKILL.md instructs the host agent to "rename the session". Today this requires the
user to manually type /rename ISV-1234, which breaks the otherwise-automated flow.
What we tried
mcp__ccd_session__mark_chapter— only sets a chapter divider inside the session,
not the session title in the sidebar/tab.
- PostToolUse / Stop hooks — cannot execute slash commands.
systemMessageJSON output from hooks — informational only, no action.
Proposed APIs (any of these would work)
- MCP tool:
mcp__ccd_session__renametaking{ name: string }. - Hook output field: e.g.
hookSpecificOutput.sessionRename: "ISV-1234". - Permission rule: a tool like
SessionRename(...)that can be approved
per-skill so the host can call it without user typing.
Why this matters
- Improves multi-session workflows (multiple Jira tickets in parallel)
- Removes the manual
/renamestep from automated skill flows - Mirrors
terminalTitleFromRenamesemantics already supported in settings.json
Environment
- Claude Code v2.1.154 (current as of writing)
- macOS / WSL
Thank you!
Proposed Solution
Proposed APIs (any of these would work)
- MCP tool:
mcp__ccd_session__renametaking{ name: string }. - Hook output field: e.g.
hookSpecificOutput.sessionRename: "ISV-1234". - Permission rule: a tool like
SessionRename(...)that can be approved
per-skill so the host can call it without user typing.
Alternative Solutions
_No response_
Priority
Medium - Would be very helpful
Feature Category
Other
Use Case Example
_No response_
Additional Context
_No response_
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗