DR-010: Git Worktree-Based Multi-Workspace Development
Status
- [x] Accepted
- [ ] Proposed
- [ ] Rejected
- [ ] Deprecated
- [ ] Superseded
Date: 2024-12-20
Context
Developers use Claude Code for AI-assisted development, often working on multiple features simultaneously. Need isolated environments with shared history.
Problem: How to enable parallel Claude Code sessions without context conflicts?
Decision
Git worktrees for parallel development with dedicated work commands.
Workspace Lifecycle:
work create <branch>- Create new worktreework pull- Sync with main via rebasework merge- Squash merge back to mainwork remove- Delete worktree and branchshow workspaces- List active worktrees
Directory Structure:
eac/ # Main workspace
../eac-feature-x/ # Worktree for feature-x
../eac-feature-y/ # Worktree for feature-y
Claude Code Integration:
- Plan → Clear → Implement pattern
- Each workspace = one Claude session
- Isolated file changes per workspace
- Agents use workspace-aware operations
Workflow Pattern:
- Create workspace for feature
- Run Claude Code session in workspace
- Implement feature with AI assistance
- Merge back to main (squash commits)
- Remove workspace when done
Consequences
Positive: Parallel sessions, isolated environments, shared history, fast switching, no stashing, context separation
Negative: Disk space (multiple working trees), user must manage workspaces, worktree commands unfamiliar
Alternatives Considered
- Branch Switching: Rejected - slow, requires stashing, context loss, file churn
- Git Stash: Rejected - error-prone, conflicts common, lost work risk
- Separate Clones: Rejected - no shared git history, duplication, sync issues
Related Decisions
Tutorials | How-to Guides | Explanation | Reference
You are here: Reference — information-oriented technical descriptions of the system.