Image: GitHub
Why it mattersA team that runs four coding agents in parallel keeps four full checkouts of the same code on disk. The disk saving matters when the agents also run on a laptop.
Leandro Ostera released git-twig this week, a small Rust tool for people running coding agents on their own machine. It makes a new git worktree that shares its files on disk with the main checkout, until the files change. The repository reached 265 stars in seven days.
A git worktree already lets a developer keep more than one branch checked out at the same time. The cost is disk space. Each worktree is a full copy of the files. A team that runs four Claude Code or Codex sessions in parallel keeps four full copies of the repository.
The copy-on-write trick
git-twig uses a filesystem feature called copy-on-write. Two worktrees share the same blocks on disk. When one worktree changes a file, only that file is copied. The rest keep sharing. The result is a worktree created in a second. Disk use stays low until the agent edits something.
The README lists the measured savings on an APFS Mac. On the Linux kernel repository, a stock git worktree takes 44.7 MiB. git-twig takes about 1.07 MiB, which the author calls 41.9 times less space. On the PlanetScale workers starter template it is 1.9 times less. On the Axo repository it is 26.7 times less. On the Pulumi documentation repository it is 155.8 times less. Creation is one to two times slower than stock git.
The tool supports macOS APFS, Linux Btrfs, Linux XFS with reflink turned on, and OpenZFS. On Windows it supports ReFS and Dev Drive. On an ordinary ext4 Linux laptop, git-twig falls back to stock git worktree. NTFS Windows disks fall back too. The README says so plainly.
Built for coding agents
The README describes the project as "lightweight git-worktrees for agents". There is a dedicated skill mode that the README shows wired into Claude Code and Codex. An agent can ask for a fresh worktree, work in it, and throw it away. The usual disk cost is gone. An existing worktree can be converted to a shared one without a fresh clone.
git-twig wraps git worktree with one new feature and adds nothing else. It is MIT licensed and small. The changelog shows version 0.5 adding file sharing across different revisions and built-in text conversions. Version 0.4 covered common line-ending policies.
A team that already runs several agents in parallel keeps the disk saving. A team that has one developer on one branch gets nothing. The second group is who the README is written for: a developer whose agents fill up a MacBook halfway through a sprint and have to be cleaned up by hand. The project stops that from happening.
Source
git-twig on GitHub, by Leandro Ostera.
This item was written by an AI system from the linked source. Reveneau is responsible for what it publishes.
Get AI News in your inbox
New developer tools, model and agent releases, and how teams are actually using them to release software. Short, and only when there is something worth reading.