A ready git worktree in ~1s, with node_modules, the dev shell and every other ignored file already there.
$ clove new feat/login
+ feat/login
✓ clone image 0.00s
✓ mount 0.70s
✓ checkout 0.21s
✓ setup mise-trust 0.02s
✓ setup direnv-allow 0.02s
· setup direnv unchanged since golden
· setup pnpm unchanged since golden
● feat-login ready in 1.0s ~/src/mono.clove/feat-login/mono| On a ~35k-file monorepo | git worktree add + setup |
clove new |
|---|---|---|
| Time to a usable checkout | ~70s | ~1s |
| New disk per worktree | a few GB | ~6 MB |
Install
The CLI and terminal UI, on macOS and Linux:
brew install pierre-borckmans/tap/clove
clove shell-init --install # cd into new clones, completions (zsh, bash, fish)The Mac app, with a menu-bar popover:
brew install --cask pierre-borckmans/tap/clove-appWithout Homebrew:
- Prebuilt binariesfor macOS and Linux are on the releases page. The macOS ones are signed and notarized.
- From source
cargo install --git https://github.com/pierre-borckmans/clove clove-cli
Then, in a repository:
clove initshows what it will set up, then builds the golden image (once)clove new feat/logina ready worktree on that branchclove service installremount clones at login, keep golden images freshclove agents installteach Claude Code and Codex to use clove (optional)Requirements
macOS
- APFS, the default filesystem.
- Tested on macOS 26, which has ASIF disk images.
- Older versions fall back to
hdiutilsparse images: implemented, but untested.
Linux
btrfs-progs(sudo apt install btrfs-progs) and loop devices. The host disk can be any filesystem.Kernel 6.7+ gives exact clone sizes (simple quotas). Older kernels use full qgroups, or report no sizes.
clove initoffers to add one line to/etc/fstab, with sudo, once per repo:shell~/.clove/repos/<repo>-<hash>/pool.btrfs ~/src/<repo>.clove btrfs loop,user,noauto,exec,user_subvol_rm_allowed 0 0How clove mounts the repo's image, in order of preference (
clove doctorsays which one a repo uses):- With that fstab lineas you, at
<repo>.clove, from a desktop or over SSH. - Without it, through udisks2if installed: only from a desktop session, with clones under
/run/media/$USER/(or/media/$USER/). sudo -nas a last resort.
- With that fstab lineas you, at
Why
git worktree addgives you the tracked files and nothing elseOn a monorepo with ~35k files, ~4.5k npm packages and a nix flake dev shell, a fresh worktree takes ~70s before anything runs:- ~40s for direnv to evaluate the flake
- ~30s for
pnpm install --offline - a few GB of new files
- Copying the ignored files over doesn't scale with file countTools like worktrunk's
copy-ignored,cp -cand the git-cow family copy-on-write file by file. That saves disk, but time grows with the number of files: that repo's ~550k ignored files take minutes, andclonefileon the rootnode_modulesalone takes ~15s. - clove copies one disk image instead of half a million files, so the cost doesn't depend on how many files the repo has.
How it works
- One golden image per repoa worktree of the base branch, with dependencies installed and dev environments warmed.
- A clone is a copy-on-write copy of it, registered as a regular git worktree with a copy of the golden index. Inodes and timestamps are kept, so git rehashes nothing.
- Then only what changed runsclove checks out your branch and reruns the setup steps whose inputs changed since the golden commit. Same lockfile, no
pnpm install. - Clones are isolatedAdding a dependency or editing the nix flake in one doesn't affect the others.
- Normal tools work inside a clonefile watchers, Docker bind mounts, Go and Rust builds.
Under the hood on macOS and Linux
macOS
The golden image is an APFS volume in a disk image file. clove new:
- copies the image file with
clonefile(2): one syscall whatever is inside, and no disk used until something is written - mounts the copy as its own volume (~0.7s)
- registers the worktree and runs the changed steps
On the monorepo above: ~1.1s and ~6 MB of disk per clone. clove init took ~1m20s, once.
Linux
- Each repo has one btrfs image file, mounted once.
- The golden worktree is a subvolume in it, and a clone is a snapshot of that subvolume, so there's no mount per clone.
- On a ~185k-file golden: the snapshot takes ~8 ms, and the first
git statusin the clone ~50 ms, with no rehash.
More in internals.
Features
- Any branch or PR, ready in ~1s
clove new feat/x,clove new pr:123, or-x claudeto start an agent in it. Commands → - CLI, terminal UI and Mac appwith the same features everywhere; every command takes
--json. Interfaces → - Shell integration
cdinto new clones, completions, and each clone's environment loaded while you're in it. Shell integration → - Brings clones up to date
clove updaterebases onto the latest base and reruns only the setup steps that changed; conflicts stop cleanly, with--continueor--abort. Updating a clone → - Works next to plain git worktreeslists them, removes them safely, or adopts them as clones. Plain git worktrees →
- Cleans up after merged PRssquash merges included, by hand or automatically, with a history to get any branch back. Cleaning up →
- Built for coding agentsone command teaches Claude Code and Codex to use clones, and turns
claude --worktreeinto one. Coding agents → - Stays fresh on its ownincremental refreshes, only when a step's inputs change on the base. Staying fresh →
- Detects your toolchainmise, direnv + nix, cargo, uv, pnpm, bun, yarn, npm, plus your own steps and local files like
.env. Configuration →
Also: limits and internals (how clones are stored on macOS and Linux).
Develop
cargo test --workspace # unit tests + an end-to-end run on real disk images (macOS)
scripts/smoke.zsh # the CLI through the zsh integration, on a throwaway repoReleasing and signing: RELEASING.md.
MIT licensed.