← all repositories
kunchenguid/treehouse

A lending library for git worktrees

Treehouse pools reusable git worktrees so every agent or task gets instant isolation without fresh clones or rebuilt caches.

1.4k stars Go Coding Assistants
treehouse
Velocity · 7d
+6.7
★ / day
Trend
cooling
star history

What it does Treehouse manages a pool of git worktrees under ~/.treehouse/, handing out clean, isolated copies of your repo when you need them and reclaiming them when you’re done. Returned worktrees keep dependencies and build cache intact, so the next user doesn’t start from zero. It tracks which worktrees are in use, leased, or dirty, and resets them to the latest default branch before reuse.

The interesting bit Instead of treating worktrees as disposable scratch space, Treehouse treats them like checked-out library books: you borrow one, work in a detached HEAD to avoid branch conflicts, and return it for the next patron. The --lease mechanism is the clever twist—it lets a script or external tool hold a worktree persistently without keeping a subshell alive, then release it later.

Key highlights

  • No background daemon; everything happens through inline CLI commands
  • Worktrees stay under ~/.treehouse/ with dependencies and build cache preserved between uses
  • Detached HEAD mode eliminates branch-name collisions entirely
  • In-use detection scans running processes and short-lived reservations to prevent conflicts
  • Safe pruning defaults to dry-run and only removes merged, clean worktrees unless you force it

Verdict Worth a look if you run multiple AI agents against the same repository or constantly context-switch between feature branches. Skip it if you already have a worktree workflow you love or rarely work outside your main checkout.

Frequently asked

What is kunchenguid/treehouse?
Treehouse pools reusable git worktrees so every agent or task gets instant isolation without fresh clones or rebuilt caches.
Is treehouse open source?
Yes — kunchenguid/treehouse is open source, released under the MIT license.
What language is treehouse written in?
kunchenguid/treehouse is primarily written in Go.
How popular is treehouse?
kunchenguid/treehouse has 1.4k stars on GitHub and is currently cooling off.
Where can I find treehouse?
kunchenguid/treehouse is on GitHub at https://github.com/kunchenguid/treehouse.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.