Documentation
¶
Overview ¶
Package worktree provides Git worktree management for parallel Claude Code execution. It enables running multiple Claude Code sessions in isolated worktrees, each with their own branch and working directory, while sharing repository history.
Index ¶
- type Manager
- func (m *Manager) CleanupAll(removeBranches bool) error
- func (m *Manager) Create(name, branch string) (*Worktree, error)
- func (m *Manager) CreateNewBranch(name, baseBranch string) (*Worktree, error)
- func (m *Manager) DiscoverExisting() error
- func (m *Manager) Get(name string) *Worktree
- func (m *Manager) GetDiff(name string) (string, error)
- func (m *Manager) HasChanges(name string) (bool, error)
- func (m *Manager) List() []*Worktree
- func (m *Manager) Remove(name string, removeBranch bool) error
- func (m *Manager) SetBaseDir(dir string)
- type Worktree
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
RepoPath string // Path to the main repository
BaseDir string // Directory for worktrees (default: .comanda-worktrees)
Worktrees map[string]*Worktree // Active worktrees by name
// contains filtered or unexported fields
}
Manager handles creation and cleanup of Git worktrees
func NewManager ¶
NewManager creates a new worktree manager
func (*Manager) CleanupAll ¶
CleanupAll removes all managed worktrees
func (*Manager) CreateNewBranch ¶
CreateNewBranch creates a worktree with a new branch from a base branch
func (*Manager) DiscoverExisting ¶
DiscoverExisting discovers worktrees that already exist in the base directory
func (*Manager) HasChanges ¶
HasChanges checks if a worktree has uncommitted changes
func (*Manager) SetBaseDir ¶
SetBaseDir changes the base directory for worktrees