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 AI client session. No stashing, no context switching — just open another terminal.
# Create worktrees/add-persistence/ — a sibling directory with its own branch/act-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/act-git-worktree delete add-persistence| Best for | Parallel features or comparing approaches |
| Setup | ACT Pro (/act-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 |
Hybrid model comparison workflow
Section titled “Hybrid model comparison workflow”When you want to evaluate two different models (e.g., Opus vs GPT) on the same feature, you can mix branch-based and worktree-based isolation depending on the artifact you are comparing.
For spec generation, staying on a single branch is often simpler because you are only producing a small number of markdown files in the same folder:
- Generate the initial spec with one model and save it as
[feature-name]-opus-spec.md - Generate the same spec with another model and save it as
[feature-name]-gpt-spec.md - Start a fresh session and ask Opus to review the differences and pick the stronger spec
- Start another fresh session and ask GPT to review the differences and pick the stronger spec
This gives you two independent proposals plus two review passes, while keeping everything easy to compare side by side in one directory.
Once you move from planning into implementation, worktrees become more useful because each model now needs its own full working directory:
- Create two worktrees from the same starting point
- Open separate AI client sessions, configured with Opus/GPT respectively
- Run the same spec and plan through
/act-workflow-workin both - Compare both implementations across the same criteria such as code quality, test coverage, and approach; if you want an extra layer of analysis, also ask each model to review both implementations and explain which one is stronger
- Keep the better result, delete the other worktree
In practice, a hybrid workflow works well: use one branch when comparing lightweight planning artifacts such as specs, then switch to worktrees when comparing full implementations that would otherwise conflict in the same checkout.
The full cycle
Section titled “The full cycle”Whichever strategy you choose, the end-to-end cycle is broadly 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 Skills — commit, push, and PR automation