[FEATURE] Detect git branch switches mid-conversation and warn the user
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
When I switch branches while in a chat with Claude the conversation and actual code can be mismatched. A warning from Claude that this might be the case, during the conversation, might help to prevent confusion and duplicate work.
Proposed Solution
A few things that would help:
- Branch awareness at conversation start — Claude Code already captures the branch in gitStatus at the start, but it's a snapshot. Detecting a branch switch mid-conversation and warning ("You switched from branch-A to
branch-B — the context of our conversation may no longer match the code") would be very valuable.
- Periodic git state checks — Before making edits, verifying the branch hasn't changed since the conversation started.
- Branch-scoped conversations — Tying a conversation to a branch so you get prompted when there's a mismatch.
Alternative Solutions
_No response_
Priority
Medium - Would be very helpful
Feature Category
CLI commands and flags
Use Case Example
_No response_
Additional Context
_No response_
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗