{"version":"2.1.326","anchor":"git-branch-detection-fix-for-detached-or-dash-leading-names","canonical_anchor":"git-branch-detection-fix-for-detached-or-dash-leading-names","heading":"Branch detection fixed when you are not on a branch","tier":"notice","area":"Git","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.326\/e\/git-branch-detection-fix-for-detached-or-dash-leading-names","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.326","markdown":"### Branch detection fixed when you are not on a branch\n\nClaude Code now detects detached HEAD and branch names starting with a dash correctly when it looks up your Git branch\n\n**What**\n\nWhen Claude Code reads which Git branch you are on, it now handles two cases correctly:\n\n- The branch name is \"HEAD\". This happens in a \"detached HEAD\" state, where you have checked out a specific commit rather than a branch.\n\n- The branch name starts with \"-\".\n\nThe old check looked at the wrong value, so the detached case was not caught.\n\n**Why**\n\nThe branch lookup now works when you are not on a branch. It also guards against a branch name that starts with a dash, which Git could otherwise read as an option.\n\n- Area: Git\n- Tier: You'll notice\n- Useful: 2\/5\n- Signal: 1\/5\n- Scope: individual\n- Heads-up: no"}