Session branch chip is stale — shows branch from session start, not current HEAD

Resolved 💬 1 comment Opened Apr 24, 2026 by ilabsllc Closed May 28, 2026

Summary

The session header chip in Claude Code (Cowork sessions specifically) shows the branch the session was bound to at creation time, and does not refresh when the branch is renamed, deleted, or when HEAD moves to a different branch during the session.

Environment

  • Claude Code (Cowork session, via Claude Desktop / web UI)
  • Host repo: standard git repo, single or multiple worktrees

Steps to reproduce

  1. Start a Claude Code / Cowork session inside a worktree currently on branch feature-xyz.
  2. During the session, delete feature-xyz locally and on the remote (e.g., after merging it into main and cleaning up).
  3. Check out a different branch — develop, main, etc. — and continue work.
  4. Look at the session header chip (the main ← feature-xyz style chip).

Expected

Chip reflects the current HEAD. For example, after checking out develop following a branch delete, the chip should show develop (or main ← develop if it also tracks a target branch).

Actual

Chip still shows the original feature-xyz branch from session creation time, even though:

  • The branch no longer exists locally (git branch doesn't list it)
  • The branch no longer exists on remote (git ls-remote doesn't list it)
  • Git itself has no trace of it (checked for-each-ref, packed-refs, reflog, .git/info/refs)

Impact

Minor — mostly cosmetic confusion. Git CLI operations (commit / push / merge) work correctly because they ignore the chip. But the UI sows doubt about where work is actually landing, and made me second-guess whether my cleanup had succeeded.

Suggested fix

Poll git symbolic-ref --short HEAD (or git branch --show-current) on a short interval, or subscribe to file-system events on .git/HEAD, and update the chip. Fall back to the short commit SHA when in detached HEAD. VS Code's source-control view does this.

Workaround

Starting a new Claude Code session in the current worktree rebinds the chip correctly.

View original on GitHub ↗

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