/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
- Be inside a git repository with a checked-out branch (e.g.
my-feature-branch) - Run
/rename new-session-namein a Claude Code session - 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
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗