Claude writes better commit messages than most engineers at 5pm on Friday — and worktrees let you run three Claude sessions on three feature branches simultaneously without conflict. Parallel agentic work is the unfair advantage of 2026.
Learning Objectives
After this lesson, you will be able to:
Use Claude Code for the full git lifecycle — branches, commits, PRs, releases — with conventional-commit messages and proper safety
Apply git worktrees to run parallel Claude Code sessions on different feature branches without merge conflicts
Configure CLAUDE.md and settings.json to prevent the four classic git incidents (force-push to main, lost commits, accidental rm of .git, broken history)
Pick the right pattern — main session, fork, or worktree-isolated agent — for any git workflow
feat(auth): add OAuth login via Google
fix(api): handle null user in /me endpoint
docs(readme): clarify setup instructions
refactor(db): extract connection pooling helper
test(auth): add edge case for expired tokens
chore(deps): bump react to 19.0.4
If your project uses different conventions, document them in CLAUDE.md:
markdown
## Commit Conventions
- Use conventional commits: feat:, fix:, docs:, refactor:, test:, chore:
- Scope is the affected module (e.g., feat(auth), fix(api/users))
- Subject in lowercase, imperative ("add", not "added" or "adds")
- Body explains WHY, not WHAT (the diff shows what)
Claude will read this and produce matching commits.
A git worktree is a second working directory tied to your main repo, but checked out to a different branch.
bash
# Main repo at ~/projects/myapp on branch main
cd ~/projects/myapp
git worktree add ../myapp-feat-auth feat/auth-rewrite
git worktree add ../myapp-feat-billing feat/billing-redesign
# Now you have three working directories:
ls ~/projects/
# myapp/ ← main branch
# myapp-feat-auth/ ← feat/auth-rewrite branch
# myapp-feat-billing/ ← feat/billing-redesign branch
Open three Claude Code sessions, one per directory. They work in parallel without conflict.
> /git commit # claude analyzes diff, writes commit message
> /git pr # claude opens PR with summary
> /git review # claude reviews uncommitted changes
> /git status # claude summarizes git status
(Custom slash commands — define in .claude/commands/ or .claude/skills/.)