About this project

Simgit is a command-line tool designed to create and manage Git worktrees with enhanced disk efficiency and isolation, primarily for scenarios involving multiple AI agents or parallel development efforts on a single repository. It achieves this by utilizing copy-on-write (CoW) mechanisms, ensuring that unchanged files across multiple worktrees share physical disk space rather than being duplicated. The tool supports various operating systems and filesystems: * **macOS (APFS)**: Leverages native `clonefile` with zero dependencies. * **Linux (btrfs, xfs)**: Uses native reflink capabilities with zero dependencies. * **Linux (ext4, etc.)**: Falls back to `fuse-overlayfs` for CoW functionality without requiring root or kernel modules. * **Windows**: Not directly supported, but can be used under WSL with a supported Linux filesystem. Simgit operates without a daemon or server, relying on Git for references and the filesystem for data management. Each worktree functions as a standard Git linked checkout, providing full isolation for branches, indexes, and working trees. This allows agents to work in parallel on their own branches and integrate changes through normal Git merges. The key benefit is the marginal cost of each additional worktree, which is significantly lower than a full `git worktree` copy. Measurements show costs scaling with the number of tracked paths (approximately ~0.4 KiB per tracked path plus ~60 KiB fixed overhead on APFS), rather than the content size. This makes it particularly efficient for repositories with large files. Simgit offers commands for adding, listing, removing, and garbage collecting worktrees. The `sg run` command facilitates launching agents within these isolated worktrees, allowing them to interact with the repository as if it were an ordinary checkout. It supports sparse checkouts to further reduce disk usage for agents focused on specific subtrees. Worktrees can be marked as ephemeral for automatic garbage collection or persistent for long-term use. The tool also provides JSON output for programmatic orchestration.