Git Worktrees

A Git worktree is an additional working directory linked to the same repository. Each worktree has its own checked-out branch, index, and working files — but they all share the same Git object database. This means you can have multiple branches checked out simultaneously without cloning the repository multiple times.

How Ticket House Uses Worktrees

When you open a workspace for a ticket, Ticket House creates a Git worktree dedicated to that ticket. This gives each ticket its own isolated directory with its own branch, so work on different tickets never interferes.

Worktrees are stored under:

.ticket-house/worktrees/<worktree-name>/

Each worktree directory is a full working copy of your project on a ticket-specific branch.

Branch Naming

Ticket House creates branches based on the ticket ID and a worktree name. For example, a ticket MA-5 might get a branch like ma-5-fix-login-bug. The branch is created from the current main branch at worktree creation time.

Isolation Benefits

  • No branch switching — work on multiple tickets without git stash or git checkout
  • AI agent safety — each agent works in its own directory, preventing conflicts
  • Independent builds — each worktree can have its own node_modules, build artifacts, etc.
  • Clean separation — changes for one ticket don't leak into another

Disk Usage

Worktrees share the Git object database, so they use less disk space than full clones. However, each worktree has its own working files. You can configure disk usage warnings and limits in .ticket-house.json:

{
  "worktrees": {
    "warningLimitMB": 2000,
    "maxLimitMB": 5000,
    "cleanupDelayMinutes": 60
  }
}