CC-301e · Module 1

Branch Model Selection

3 min read

The branching model you choose determines how Claude Code interacts with your repository. Trunk-based development — where everyone commits to main through short-lived feature branches — is the model that works best with Claude Code. The branches are small, the diffs are readable, and merge conflicts are rare because branches live for hours, not weeks.

Gitflow, with its develop, release, and hotfix branches, adds coordination overhead that Claude cannot manage autonomously. Claude does not know whether your current work belongs on develop or on a release branch. It does not know whether a hotfix should be cherry-picked or merged forward. These are judgment calls that require knowledge of your release cycle, and encoding that knowledge into CLAUDE.md is possible but fragile — it changes every sprint.

Do This

  • Use trunk-based development with short-lived feature branches
  • Document your branch naming convention in CLAUDE.md
  • Let Claude create branches with descriptive names: feature/add-auth, fix/type-error-423
  • Merge feature branches within 1-2 days to minimize drift

Avoid This

  • Use long-lived feature branches that drift for weeks
  • Assume Claude knows your branching model without explicit CLAUDE.md rules
  • Use generic branch names like "claude-changes" or "wip"
  • Let branches accumulate without merging — conflict probability grows quadratically