/rename command renames the current git branch in addition to the session

Resolved 💬 1 comment Opened Mar 5, 2026 by elhoyos Closed Mar 5, 2026

Bug Report

Description

The /rename <name> slash command in Claude Code is documented as renaming the current conversation/session. However, it also renames the current git branch to the same name when run inside a git repository.

Steps to Reproduce

  1. Be inside a git repository with a checked-out branch (e.g. my-feature-branch)
  2. Run /rename new-session-name in a Claude Code session
  3. Observe that the git branch has been renamed to new-session-name

Expected Behavior

/rename should only rename the Claude Code session. Git branches should not be affected.

Actual Behavior

The current git branch is renamed to match the session name (confirmed via git reflog):

HEAD@{...}: Branch: renamed refs/heads/my-feature-branch to refs/heads/new-session-name

Impact

  • Caused an unintended new GitHub PR to be created (instead of updating the existing one) after gt submit, because Graphite saw a new branch name
  • Silently mutates git state the user did not intend to change

Environment

  • Platform: macOS (darwin 25.2.0)
  • Shell: zsh

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗