claude-code - 💡(How to fix) Fix Show git branch in remote (SSH) workspace chip row [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#52690Fetched 2026-04-24 10:42:19
View on GitHub
Comments
2
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×3commented ×2

When starting a Claude Code session against a remote machine over SSH, the workspace chip row shows an empty branch indicator () instead of the current git branch. Local sessions against the same folder correctly display the branch name. It would be useful to have parity between local and remote workspaces for branch display.

Root Cause

Without the branch displayed, there's no at-a-glance way to confirm which branch a remote session is targeting before you start asking Claude to make changes. This is especially relevant when working across multiple repos or when worktrees are involved.

RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing requests and this feature hasn't been requested yet
  • This is a single feature request (not multiple features)

Problem Statement

Summary

When starting a Claude Code session against a remote machine over SSH, the workspace chip row shows an empty branch indicator () instead of the current git branch. Local sessions against the same folder correctly display the branch name. It would be useful to have parity between local and remote workspaces for branch display.

Current behavior

Remote SSH session chip row: <Machine> | <Folder> | ⎇ — | ☐ worktree

  • Branch chip displays even when the folder is a valid git repo on a checked-out branch
  • The branch chip is non-interactive (clicking does nothing)
  • The "+" (new workspace) button next to the worktree checkbox is missing

Running git branch --show-current on the remote correctly returns the branch (e.g. main), so the underlying git state is fine — the UI just doesn't surface it.

Why this matters

Without the branch displayed, there's no at-a-glance way to confirm which branch a remote session is targeting before you start asking Claude to make changes. This is especially relevant when working across multiple repos or when worktrees are involved.

Environment

  • Claude Code (desktop app) on macOS, connecting via SSH to another macOS host
  • Remote folder is a clean git repo on main
  • Not using worktree mode (checkbox unchecked)

Proposed Solution

Expected behavior

Remote SSH session chip row should display the detected branch the same way local sessions do: <Machine> | <Folder> | ⎇ main | ☐ worktree

Ideally the chip would also be clickable to switch branches, matching local behavior. At minimum, displaying the branch name would provide visual confirmation of what branch the session will operate on.

Alternative Solutions

No response

Priority

Medium - Would be very helpful

Feature Category

File operations

Use Case Example

No response

Additional Context

Screenshots

Local session (branch shown correctly): <img width="1048" height="145" alt="Image" src="https://github.com/user-attachments/assets/da1b2091-9410-43cc-83f7-4fd00d86c105" />

Remote SSH session (branch shown as ): <img width="1054" height="137" alt="Image" src="https://github.com/user-attachments/assets/4573bfee-c70f-4334-8f29-8372c8a3ae67" />

Remote SSH session (git branch --show-current): <img width="342" height="201" alt="Image" src="https://github.com/user-attachments/assets/dafe4065-32a8-4165-961c-9c34be445c17" />

extent analysis

TL;DR

The issue can be addressed by modifying the Claude Code application to execute a git branch --show-current command on the remote machine and display the result in the workspace chip row.

Guidance

  • Investigate how the local session retrieves and displays the current git branch, and apply the same logic to remote SSH sessions.
  • Modify the remote SSH session code to execute git branch --show-current on the remote machine and update the UI to display the result.
  • Consider adding error handling for cases where the remote folder is not a valid git repository or the branch cannot be determined.
  • Review the differences in UI behavior between local and remote sessions to ensure consistency and identify potential areas for improvement.

Example

No code example is provided as the issue does not include specific code snippets or APIs used by the Claude Code application.

Notes

The solution assumes that the Claude Code application has the capability to execute remote commands on the SSH-connected machine and update the UI accordingly. The exact implementation details may vary depending on the application's architecture and technology stack.

Recommendation

Apply workaround: Modify the application to execute git branch --show-current on the remote machine and display the result, as this provides a clear and direct solution to the issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

Remote SSH session chip row should display the detected branch the same way local sessions do: <Machine> | <Folder> | ⎇ main | ☐ worktree

Ideally the chip would also be clickable to switch branches, matching local behavior. At minimum, displaying the branch name would provide visual confirmation of what branch the session will operate on.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Show git branch in remote (SSH) workspace chip row [2 comments, 2 participants]