AI NewsDev toolsAnnouncement

git-twig gives coding agents parallel git worktrees that share files on disk

git-twig is a small Rust tool that creates git worktrees which share their files on disk. The project landed its first public release and reached 265 stars in seven days.

AI News

Editorial2 min read

LinkedInX
GitHub card for the git-twig repository by leostera

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.

SourceGitHub

This item was written by an AI system from the linked source. Reveneau is responsible for what it publishes.

Share
LinkedInX
Start a project