While working with Claude Code, I quickly needed it to operate on multiple versions of the rqlite codebase at the same time. Cloning the repository repeatedly would have worked, but it felt wasteful.
Instead, today I learned about git worktree. It allows a single Git repository to have multiple checked-out working directories, each on its own branch, while sharing the same object store. The result is fast setup, low disk use, and clean isolation between versions.
For agents that need to explore changes, test ideas, or run experiments in parallel, this is an efficient and simple approach.