Feature request: Allow configuring the 'Main branch' in gitStatus context

Resolved 💬 3 comments Opened Jan 20, 2026 by c2keesey Closed Jan 24, 2026

Summary

The gitStatus section in Claude Code's context shows:

Main branch (you will usually use this for PRs): main

This appears to be hardcoded to look for main (or master), even when the repository's actual default branch is different (e.g., dev).

Current Behavior

  • git remote show origin returns HEAD branch: dev
  • Claude Code still shows "Main branch: main" in the gitStatus context
  • This causes Claude to default to comparing against main instead of the actual default branch

Requested Behavior

Either:

  1. Respect the remote HEAD branch (git remote show origin | grep "HEAD branch")
  2. Allow users to configure this in settings.json or .claude/settings.json, e.g.:

``json
{
"git": {
"defaultBranch": "dev"
}
}
``

Workaround

Currently using CLAUDE.md to instruct Claude to use dev:

Default branch is `dev`. Default to `dev` when doing diffs, etc. `main` is only used to track deployed production code.

This works but requires explicit instruction and Claude can still default to main if not careful.

Environment

  • Claude Code version: 2.1.11
  • OS: macOS

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗