Feature Request: Allow Claude/agents to programmatically rename sessions

Status Open
Maintainer reply None cached
Activity 2 comments · opened Sep 15, 2026

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 now supports manually renaming sessions via /rename, addressing the core request from #38173.

However, session renaming currently appears to be limited to an explicit user invocation of the /rename command. Claude itself cannot rename the current session based on instructions, CLAUDE.md, agent prompts, hooks, or other automated workflows.

It would be useful to expose session renaming as an action/tool that Claude can invoke programmatically.

Problem

I would like to be able to provide instructions such as:

At the beginning of a session, rename the session to a short descriptive name based on the task being worked on.

Or define behavior in CLAUDE.md such as:

When beginning work on a GitHub issue, rename the session to [issue-number] - [short-description].

Currently, Claude can understand and follow the instruction conceptually, but it cannot actually execute /rename. The user must manually run the slash command.

This becomes especially limiting when using Claude Code with agents, automated workflows, or multiple concurrent sessions/worktrees. Session names are most valuable in these scenarios, but these are also the scenarios where manually naming every session becomes cumbersome.

Proposed Solution

Expose session renaming as something Claude itself can invoke, for example through an internal tool/action:

rename_session(name)

This would allow Claude to rename the current session when explicitly instructed to do so.

It could then be used from:

  • CLAUDE.md instructions
  • Agent prompts
  • Custom agents
  • Automated workflows
  • User prompts during a session

For example:

Work on issue #1234. Rename this session using the issue number and a short description before beginning.

Claude could then automatically set the session name to something like:

1234 - Fix authentication timeout

Why This Matters

The addition of /rename solves the underlying session-naming problem, but requiring manual invocation prevents session naming from becoming part of automated Claude Code workflows.

As Claude Code increasingly supports agents, parallel work, worktrees, and automated development workflows, being able to automatically assign meaningful session names would make /resume and session management significantly easier.

This would be particularly useful when orchestrating multiple Claude Code sessions where each agent/session is working on a different issue or task.

Related

This builds on #38173, which requested the original session rename capability. /rename now exists; this request is specifically about allowing Claude itself to invoke that functionality programmatically when instructed.

View original on GitHub ↗

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