Repository navigation
Description
Feature hasn't been suggested before.
- I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Feature hasn't been suggested before.
- I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Willing to Pay / Sponsor This Feature
- I am willing to financially support / sponsor development of this feature if needed.
- This is a high-impact UX improvement that I would personally pay for.
Summary
OpenCode would benefit from a visual Git branch indicator built directly into the prompt input UI. This provides instant visibility of which branch users are working on without leaving the interface or running terminal commands.
Today, users have no visual indication of their current Git branch within the main interface, creating cognitive overhead when working across multiple branches.
🎯 Goals
- Display the current Git branch name in the prompt input dock tray
- Position it after the auto-accept permissions (shield) button
- Work on both web and desktop (using the existing server
/vcsendpoint) - Update in real-time when the branch changes
- Hide when the project is not a Git repository
- Support internationalization (17 languages)
🧠 Proposed UX
Visual Layout
+-------------------------------------------------------------------------+
| [Agent v] [Model v] [Variant v] [shield] [🌿 feature/branch-name] |
| | | |
| | +-- NEW BRANCH INDICATOR |
| +-- Auto-accept button |
+-------------------------------------------------------------------------+
Specifications
| Property | Value |
|---|---|
| Icon | branch (existing in icon set) |
| Text style | text-13-regular text-text-dimmed |
| Max width | 120px (truncated with ellipsis) |
| Height | 28px (h-7, matches other elements) |
| Tooltip | "Current Git branch" (localized) |
Behavior
- Hidden when project is not a Git repository
- Works on web AND desktop (uses server
/vcsendpoint) - Updates in real-time when branch changes (via
vcs.branch.updatedevent) - Tooltip shows "Current Git branch" on hover
- Long branch names truncate gracefully with ellipsis
📁 Technical Approach
Uses the existing server VCS endpoint (/vcs) which already tracks the current branch and emits real-time events on branch changes. No new backend work required.
// prompt-input.tsx
const branch = createMemo(() => sync.data.vcs?.branch)
<Show when={branch()}>
<Tooltip placement="top" gutter={8} value={language.t("prompt.branch.tooltip")}>
<div class="flex items-center gap-1 px-2 h-7 text-13-regular text-text-dimmed">
<Icon name="branch" size="small" />
<span class="truncate max-w-[120px]">{branch()}</span>
</div>
</Tooltip>
</Show>Files Modified
| File | Change |
|---|---|
packages/app/src/components/prompt-input.tsx |
Add branch memo and UI |
packages/app/src/i18n/*.ts |
Add prompt.branch.tooltip translation (17 languages) |
🔗 Worktree-Aware by Design
This feature is designed to be compatible with git worktrees:
- Branch indicator shows the current worktree's branch
- Serves as foundation for future worktree UI enhancements
✅ Why This Is Not a Duplicate Request
Existing issues focus on git worktree infrastructure and workspace handling. This request is different because it addresses visual branch awareness in the UI - a simple UX improvement that complements those efforts.
🔗 Related Issues
- feature request: git worktree integration #564
- Multiple model usage with git worktrees #6679
- git worktrees and root-directory #2445
- Desktop app: opening multiple git worktrees replaces existing project #5638
🚀 Implementation Available
I have already implemented this feature and am ready to submit a PR:
- Branch:
feature/git-current-branch-indicator - Repository: https://github.com/slorenzot/opencode
💡 Key Benefits
-
✅ Essential for AI-assisted development: When working on projects with multiple branches, it's critical to always know which branch you're on when requesting code changes from the AI. Without this visibility, users risk accidentally committing AI-generated changes to the wrong branch (e.g.,
maininstead offeature/new-login), leading to potential production issues or messy git histories. -
✅ Prevents costly mistakes: A simple glance at the branch indicator before asking "refactor this component" or "fix this bug" ensures the AI's changes land in the correct context.
-
✅ Instant Git branch visibility without running commands
-
✅ Zero configuration required (built-in)
-
✅ Works on both web and desktop
-
✅ Uses existing infrastructure (no backend changes)
-
✅ Supports 17 languages
-
✅ Lays foundation for future worktree UI
Activity
github-actions commentedon Mar 16, 2026
This issue might be a duplicate of existing issues. Please check:
/vcsendpoint — very similar scope and motivationPlease review these issues and consider whether your request adds something distinct, or if it would be better addressed as a comment or contribution to one of those existing issues.
benizzio-opencode commentedon May 31, 2026
Adding another data point from using OpenCode Desktop through the opencode harness.
Right now it is difficult to reliably tell which Git branch the active agent/session is running on without asking the agent or opening another session/window to inspect the context. That makes it too easy to lose track of whether work is happening on the intended branch or worktree.
This is important consistency information during agent-driven work. The current session UI should persistently show the active Git branch so users can verify at a glance that changes are being made in the expected context.
xingxiulaomo commentedon Jul 20, 2026
👍 +1 Git sync status visualization would help avoid forgetting to push/pull. Very useful feature!
github-actions commentedon Sep 19, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.