Skip to content
プロジェクト

概要

Copy-on-write git worktrees with dependencies already installed

開発ツール

この数値の測り方

計測したスター増加

24時間
+1
7日間
履歴を収集中
15日間
履歴を収集中
1か月
履歴を収集中

期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。

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, deno, uv, Poetry, PDM, Bundler, Composer, Go, Gradle, Maven, .NET, Dart/Flutter, Mix, SwiftPM, CocoaPods, Zig and cargo, in nested projects at any depth (workspace members are left to their workspace), plus your own steps, which can replace a detected one by name, and files like .env. → Configuration
  • Stays fresh on its own: refreshes only when a step's inputs change on the base; a running refresh shows its step everywhere and can be cancelled. → Staying fresh
  • Learns the steps you're missing: clove suggest finds the installs, builds and codegen agents kept running by hand in fresh clones, and turns them into [[add_step]] entries with their evidence. → Setup suggestions
  • CLI, terminal UI and desktop app with the same features, --json on every command, and a shell integration that loads each clone's environment. → Interfaces, shell integration
  • Clones on another computer: the app, clove on lab ls and the terminal UI drive clove on a Linux box or another Mac over ssh; clove machines install sets clove up there. → Other machines
  • Repos in your order: drag them in the app's sidebar, press ( ) in the terminal UI, or run clove repos move web 1. All three list them the same way. → Interfaces

Also: limits, internals, and every command, flag and setting generated from the code: commands reference, configuration reference.

FAQ

How do I run several Claude Code or Codex agents in parallel on one repo?

Give each agent its own clone. clove new feat/x -x claude makes one and starts Claude Code in it. After clove agents install, claude --worktree and Claude Code's subagent worktrees become clones on their own, and Codex, OpenCode and Pi get instructions to use clones. Clones are isolated: one agent's installs, builds and edits don't touch the others. → Coding agents

Why not plain git worktree add?

It checks out the tracked files and nothing else, so every new worktree reinstalls node_modules, rebuilds its dev shell and needs its .env again. On a ~35k-file monorepo that is ~70s and a few GB per worktree. clove clones a golden image where that work is already done: ~1s and ~6 MB. On the benchmark repo, clove new takes 926 ms, or 61 ms when a spare clone is mounted ahead of time.

Does it work with pnpm, uv, cargo and monorepos?

Yes. clove detects pnpm, bun, yarn, npm, uv, Poetry, cargo and more in each directory, including nested projects with their own lockfile, and warms them in the golden image. Python virtualenvs and cargo's target/ record the absolute path they were built at, so those rebuild in a clone. → Configuration, limits

Does it run on macOS and Linux?

Both. On macOS it uses APFS disk images; on Linux, btrfs in a loop-mounted image file, so the host disk can be any filesystem. The CLI, the terminal UI and the desktop app run on both. Requirements are under Quick start.

How is it different from other worktree tools?

Most copy ignored files one by one or run a setup script per worktree, so the time grows with the repo. clove copies one disk image (macOS) or snapshots one subvolume (Linux), so a clone costs the same whatever the file count. The tools it builds on and sits next to are listed in prior art.

Prior art

clove puts together ideas that already exist, and git and the file system do most of the work. The closest projects:

  • Grove: a "golden copy" with warm build state, cloned with cp -c -R, and an experimental macOS backend on a sparsebundle disk image. Workspaces are full clones, not worktrees; Linux is planned.
  • rift: workspaces for agents by clonefile, btrfs snapshots or reflinks (XFS too). Copies your current working state, uncommitted changes included; OpenCode can use it as its worktree backend.
  • worktrunk: worktrees for parallel agents, with hooks and copy-ignored, which reflinks ignored files one by one. Works on any file system; time grows with file count.

What clove adds is the combination. The golden image is one disk image (macOS) or subvolume (Linux), so a clone costs the same whatever the file count. Every clone is a regular git worktree with dependencies already installed. The image stays fresh by rerunning only the steps whose inputs changed, and the agent tooling (worktree hooks, session links, clove ps, checkpoints) sits around it.

Everything else nearby

git

Copy-on-write in the file system

Worktree managers that copy or set up

  • gwq, wtp, git-worktree-runner: copy or symlink listed files and run setup commands after create. Plain shell and files, nothing to mount.
  • git-sprout: a drop-in git worktree add that clones unmodified tracked files. No ignored files.
  • git-twig: also a drop-in git worktree add that reflinks tracked files, on APFS, XFS, btrfs and Windows ReFS, and falls back to a plain worktree where it can't. No ignored files.
  • lane: reflinks ignored files into each worktree one by one, and keeps notes anchored to code that are flagged when it changes.

Copy-on-write workspaces

  • cow: one clonefile(2) of the whole repo, node_modules included. Nothing to keep fresh.
  • ovnfs: a daemon that serves copy-on-write views of any folder over FUSE, NFS or SMB, without root or a special file system. node_modules and build output are read from the original folder, and builds go through the mount.

Parallel coding agents

  • Claude Code --worktree and the Codex app: a worktree per session, .worktreeinclude to copy ignored files, setup left to you or a script. Claude Code's WorktreeCreate hook is how clove plugs in.
  • Conductor, vibe-kanban, Sculptor, claude-squad, uzi, Crystal: worktree per agent, a setup script per workspace in most, and far richer UIs for reviewing and merging agent work than clove has.
  • container-use and Codex cloud: a container per agent, which isolates processes and ports too. Codex caches the container after its setup script, a golden image of sorts, in the cloud.

Warm dev environments

Develop

cargo test --workspace                           # unit tests + an end-to-end run on real disk images (macOS)
CLOVE_E2E=1 cargo test -p clove-cli --test e2e   # the CLI end to end, one YAML scenario per test
scripts/smoke.zsh                                # the CLI through the zsh integration, on a throwaway repo

Rules for changes, for people and coding agents: AGENTS.md. Building each part, tests, code style, and adding a toolchain, agent, app or backend: CONTRIBUTING.md. Benchmarks: docs/benchmarks.md, charted on clove.fast/benchmarks. Releasing: RELEASING.md.

MIT licensed.

関連プロジェクトを探す

読み込み中…