Core Concept: How treehouse manages worktree isolation
maintreehouse provides fast, isolated, and reusable Git worktrees for parallel coding-agent work. It is designed to automate the lifecycle of these worktrees so that users or orchestration systems do not have to manage them manually.
Key Principles:
- Isolation: Each acquisition (lease) of a worktree ensures that no other acquisition can claim it until it is returned.
- Reuse Safety: While pooling allows for fast reuse, a reused worktree must meet the same correctness standards as a new one. It must not be dirty, in-use, or unverifiable.
- Lifecycle Ownership: treehouse owns the worktree lifecycle (creation, leasing, and cleanup) rather than delegating this to the agent orchestration or the user's development workflow.
- Scope: treehouse is a local CLI primitive that composes with Git, shells, and coding agents. It is not a security sandbox; it isolates working directories and lifecycle ownership, but does not provide process-level security isolation.