全部软件
cloveUtilities
版本
v0.1.44
发布日期
2026-12-02
平台
macOS
安装包大小
macOS 19.2 MB
发布者
pierre-borckmans
Utilities · pierre-borckmans

clove

A ready git worktree in ~1s, with node modules , the dev shell and every other ignored file already there.

版本 v0.1.44
macOS

README

clove

ci release license

A ready git worktree in ~1s, with node_modules, the dev shell and every other ignored file already there.

clove.fast, with a video and the docs.

$ 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

~1s is a cold clone, mount included. On macOS clove keeps one clone mounted ahead of time, so the next clove new skips the mount: 61 ms on the benchmark repo.

The clove desktop app: a repo's golden image with its warm steps, and its clones with branch, changes, PR state and size

The clove terminal UI: repos, clones with branch, changes and size, and the selected clone's details and timings

The desktop app and the terminal UI show the same things, and the CLI does it all too.

clove new feat/login in a terminal: the clone is ready in 18 ms, then npm test passes in it

Recorded on Linux (btrfs) with a small demo repo. On macOS, a cold clone of a big monorepo takes about a second.

More recordings: checkpoint and rewind, the trash, ls and psclove checkpoint, then rm -rf src in the clone, then clove rewind brings src backclove rm moves a clone to the trash, clove trash lists it, clove restore brings it backclove ls lists clones with branch, changes and size; clove ps shows the dev server running in one

Install

brew install pierre-borckmans/tap/clove              # CLI and terminal UI, macOS and Linux
brew install --cask pierre-borckmans/tap/clove-app   # desktop app with a menu-bar popover, macOS
clove shell-init --install                           # cd into new clones, completions (zsh, bash, fish)

Quick start

In a repository:

clove init                       # shows what it will set up, then builds the golden image (once)
clove new feat/login             # a ready worktree on that branch
clove service install            # remount clones at login, keep golden images fresh
clove agents install             # teach Claude Code, Codex, OpenCode and Pi to use clove (optional)
Other ways to install

The desktop app on Linux (x86_64 and arm64): a .deb and an AppImage are on the releases page. It runs the CLI for the background service, so install that too.

sudo apt install ./clove-app-v<version>-x86_64.deb    # Debian, Ubuntu
chmod +x clove-app-v<version>-x86_64.AppImage         # anywhere else; needs libfuse2

Without Homebrew:

  • npm: npm i -g @pborck/clove, or npx @pborck/clove. Same binaries as the releases; clove upgrade only handles Homebrew, so upgrade with npm.
  • Prebuilt binaries for 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
Requirements

macOS

  • APFS, the default filesystem.
  • Tested on macOS 26, which has ASIF disk images.
  • Older versions fall back to hdiutil sparse images: implemented, but untested.

Linux

  • btrfs-progs (sudo apt install btrfs-progs, sudo pacman -S btrfs-progs), a kernel with btrfs 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 init offers to add one line to /etc/fstab, with sudo, once per repo:

    ~/.clove/repos/<repo>-<hash>/pool.btrfs ~/src/<repo>.clove btrfs loop,user,noauto,exec,user_subvol_rm_allowed 0 0
    
  • How clove mounts the repo's image, in order of preference (clove doctor says which one a repo uses):

    • With that fstab line: as you, at <repo>.clove, from a desktop or over SSH.
    • Without it, through udisks2 if installed: only from a desktop session, with clones under /run/media/$USER/ (or /media/$USER/).
    • sudo -n as a last resort.
  • On WSL with Docker Desktop, run clove config set clone_root '/mnt/wsl/clove/{repo}' before clove init. Docker Desktop sees only mounts under /mnt/wsl, so elsewhere a container shows a clone as an empty folder. /mnt/wsl is cleared when WSL restarts, and clove makes the folder again on the next mount. clove doctor warns when the setting is missing.

Why

  • git worktree add gives you the tracked files and nothing else. On 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 count. worktrunk's copy-ignored and cp -c -R copy-on-write file by file (more in prior art). That saves disk, but time grows with the number of files: that repo's ~550k ignored files take minutes, and clonefile on the root node_modules alone 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

clove builds one golden image per repo from the base branch, local files and warm steps, then makes each clone a copy-on-write copy of it in about a second
  • One golden image per repo: a 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 runs: clove checks out your branch and reruns the setup steps whose inputs changed since the golden commit. Same lockfile, no pnpm install.
  • Clones are isolated. Adding a dependency or editing the nix flake in one doesn't affect the others.
  • Normal tools work inside a clone: file 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:

  1. copies the image file with clonefile(2): one syscall whatever is inside, and no disk used until something is written
  2. mounts the copy as its own volume (~0.7s)
  3. 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 status in the clone ~50 ms, with no rehash.

More in internals.

Features

Clones

  • Any branch or PR, ready in ~1s: clove new feat/x, clove new pr:123, or -x claude to start an agent in it. → Commands
  • Checkpoints, rewind and fork: freeze a clone in ~0.05s, put it back in ~1.5s, or fork it with its uncommitted state. → Checkpoints
  • Each clone knows who it is: CLOVE_ID, CLOVE_BRANCH and a CLOVE_PORT_OFFSET of its own keep dev servers and docker compose projects apart; teardown cleans up on removal. → Clone identity
  • Updates and renames: clove update rebases and reruns only the changed steps; clove rename moves folder, image and branch. → Updating, renaming
  • Groups: file clones under a name (clove group feat-a feat-b billing, clove new --group billing) and the list and the map show them together. clove suggests groups from branch names, and never applies them by itself. → Groups
  • Next to plain git worktrees: lists them, removes them safely, or adopts them as clones. → Plain git worktrees

Coding agents

  • One command sets up Claude Code, Codex, OpenCode and Pi to use clones, native worktrees included, and keeps that setup current across upgrades. → Coding agents
  • Agent sessions linked to their clone: read one as a conversation, follow a live one, or resume it. → Agent sessions
  • PRs that need attention: failing checks, requested changes and conflicts show on the clone, and the agent that owns it hears about them, and about the merge. → PRs
  • Sees what runs in a clone: shells, dev servers, editors and agents, with their ports; removing a clone stops them first. → Processes

Cleanup

  • Cleans up after merged PRs, squash merges included, by hand or on its own, with a history to get any branch back. → Cleaning up
  • Closes PRs you give up on: clove close closes the PR on GitHub, trashes the clone, and deletes its branch here and on the remote, unless someone pushed to it since. → Closing a PR
  • Removed clones go to a trash for a day; clove restore brings one back with its uncommitted files and checkpoints. → The trash
  • Leaving is one command: clove deinit --all removes every clone, the trash and the golden image, and refuses while a clone holds unsaved or unpushed work. The checkout and its branches stay. → Stop using clove
  • Disk usage that counts shared blocks once: clove du splits a repo's disk into the golden image, each clone's own bytes, checkpoints, the spare and the trash, says what removing each frees, and shows what a clone holds by folder. → Disk usage

Setup

  • Detects your toolchain: mise, direnv + nix, pnpm, bun, yarn, npm, de