Feature branches, experiment branches, and the merge review discipline.
AI-assisted development changes the risk profile of a git branch. Claude can touch more files faster than you would manually — which means a bad decision propagates further before you catch it. The right branch strategy contains that risk without slowing down.
⬡ What you'll build
Feature branches — Standard feature development. One branch per feature. Claude does the implementation work here. You review and merge.
main
└── feat/user-notifications ← Claude builds here
└── feat/export-csv ← separate feature, parallel development
Experiment branches — When Claude is trying an approach you're not sure will work. Cheap to create, easy to delete, no guilt about throwing away.
main
└── feat/auth-refactor
└── exp/auth-jwt-approach ← trying one approach
└── exp/auth-session-approach ← trying another
Fix branches — For isolated bug fixes. Short-lived, narrow scope. Merge fast or throw away.
main
└── fix/dashboard-filter-reactivity
This is the most underused pattern in AI-assisted development.
When to use it: Any time you're not sure Claude's architectural approach will work. This includes:
The workflow:
# Start from your feature branch
git checkout feat/notification-system
# Create experiment branch for Claude's first approach
git checkout -b exp/notifications-websocket
# Let Claude implement fully, then test
# ... testing ...
# If it works — merge back to feature branch
git checkout feat/notification-system
git merge exp/notifications-websocket
# If it doesn't — just delete it
git checkout feat/notification-system
git branch -D exp/notifications-websocket
# Zero cost. Start again with a different approach.The psychological value: you can let Claude try something ambitious without worrying about polluting your main feature branch. The experiment is isolated by design.
Long Claude sessions — 30+ minutes, 10+ files changed — should not wait until the end to commit. Stage and commit natural checkpoints.
Commit when:
Don't commit when:
Pattern: checkpoint commits
# After Claude builds the UserStats component:
git diff --staged # review
tsc --noEmit # verify TypeScript
git add components/dashboard/StatsCard.tsx
git commit -m "feat(dashboard): add StatsCard component with API integration"
# Continue — Claude builds the ActivityFeed
# After that's reviewed and TypeScript passes:
git add components/dashboard/ActivityFeed.tsx app/api/user/activity/route.ts
git commit -m "feat(dashboard): add ActivityFeed with paginated activity API"
# Now assemble the page
# ...Checkpoint commits mean if Claude breaks something in the next step, you have a clean recovery point.
Consistent naming makes it easy to understand the history and scope of AI work:
Branch naming conventions
feat/descriptionStandard feature development with Claude.
feat/user-notifications
fix/descriptionIsolated bug fix.
fix/auth-redirect-loop
exp/descriptionExperiment — uncertain approach, may be discarded.
exp/auth-websocket-approach
refactor/descriptionRefactoring — no new behavior, structural changes.
refactor/extract-validation-lib
chore/descriptionConfig, dependencies, tooling — not product features.
chore/upgrade-next-15-5
Add this naming convention to your CLAUDE.md so Claude creates branches with the right names automatically.
The most important rule: never merge AI work into main without reviewing the diff yourself.
Claude's summary of what it did is accurate most of the time. But "most of the time" isn't good enough for main. The diff review catches:
The merge review checklist:
This takes 5–10 minutes for a medium-sized feature. It's not optional.
Failure Pattern — Merging on Claude's word
✕ Before (broken pattern)
> I've completed all the changes. The notification system is > working correctly with email and in-app channels. TypeScript > passes and the tests are all green. // Merged directly to main without reviewing the diff. // Claude missed that it had changed app/layout.tsx in a way // that broke the mobile menu on every page.
✓ After (production pattern)
// After Claude reports completion: git diff main...feat/notifications | head -200 tsc --noEmit npm test // Found: app/layout.tsx changed unexpectedly. // Reverted that file, confirmed everything else was correct. // Merged safely.
Lesson: Claude's completion summary reflects its intent, not necessarily the full reality of what changed. The diff review is the safety net that catches the gap.
Your branch strategy is production-safe when: