Git Workflow Strategies
The core workflow (Spec → Plan → Work → Compound) runs the same regardless of how you manage branches. This guide covers the two git strategies for isolating that work, and when to pick each one.
Strategy 1: Branch-based (serial)
Section titled “Strategy 1: Branch-based (serial)”The default for most tasks. You create a feature branch, run the full workflow, ship, and return to main.
git switch -c feature/add-persistence# Spec → Plan → Work → Compound/act:git:push-make-pr# Merge PR on GitHub/act:git:switch-main-pullgit branch -d feature/add-persistence| Best for | One feature at a time |
| Setup | None — standard git |
| Context switches | Stash or commit before switching |
| CLI sessions | One |
Strategy 2: Worktree-based (parallel)
Section titled “Strategy 2: Worktree-based (parallel)”Each feature gets its own directory, branch, and Claude session. No stashing, no context switching — just open another terminal.
# Create worktrees/add-persistence/ — a sibling directory with its own branch/git-worktree create add-persistence# Open a new terminal at the worktree directorycd worktrees/add-persistenceclaude# Spec → Plan → Work → Compound/act:git:push-make-pr# Merge PR on GitHub, then clean up/git-worktree delete add-persistence| Best for | Parallel features or comparing approaches |
| Setup | ACT Pro (/git-worktree) |
| Context switches | Switch terminals — no stashing needed |
| CLI sessions | One per worktree |
When to choose which
Section titled “When to choose which”| Factor | Branch | Worktree |
|---|---|---|
| One feature at a time | Yes | Overkill |
| Multiple features in parallel | Painful (stash/switch) | Yes |
| Comparing two models on the same feature | No | Yes — one worktree per model |
| Quick hotfix while mid-feature | Stash + switch | Create a second worktree |
| Disk space constrained | Lighter | Each worktree is a full checkout |
Model comparison workflow
Section titled “Model comparison workflow”When you want to evaluate two different models (e.g., Opus vs Sonnet) on the same feature:
- Create two worktrees from the same starting point
- Open a Claude session in each, configured with a different model
- Run the same spec and plan through
/act:workflow:workin both - Compare the results — code quality, test coverage, approach
- Keep the better result, delete the other worktree
This is the main scenario where worktrees clearly outperform branches, since you need two independent working directories at the same time.
The full cycle
Section titled “The full cycle”Whichever strategy you choose, the end-to-end cycle looks the same:
- Isolate — create a branch or worktree
- Build — run the core workflow (Spec → Plan → Work)
- Ship —
/act:git:push-make-prto create a PR - Merge — review and merge on GitHub
- Capture —
/act:workflow:compoundto save insights - Clean up — delete the branch or worktree, return to main
Related
Section titled “Related”- Workflow Overview — the Spec → Plan → Work → Compound pipeline
- Git Commands — commit, push, and PR commands
- Git Worktrees — step-by-step worktree setup and usage