worktree

Create and manage isolated git worktrees with lifecycle and cleanup rules.

8|6|Updated Mar 3, 2026
One-click install
npx skills add https://github.com/nomoory/brain-in-a-vat --skill worktree-nomoory
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: worktree
Source: https://github.com/nomoory/brain-in-a-vat/tree/main/.claude/skills/worktree
Command: npx skills add https://github.com/nomoory/brain-in-a-vat --skill worktree-nomoory

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Isolates experimental work by leveraging git worktrees to keep main branches pristine and avoid contamination during validation and testing.

Core Features & Use Cases

  • Create isolated worktrees with dedicated branches for experiments and test runs.
  • Manage life cycle: create, list, and clean up worktrees to prevent drift and clutter.
  • Enforce conventions: branch naming, lifecycle rules, and automatic cleanup guidance.

Quick Start

Create a new worktree with git worktree add ../vatty-[slug]-wt -b experiment/[slug] and run your experiments in the new directory.

Frequently Asked Questions about worktree

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create an isolated git worktree for experimental development?

To create an isolated git worktree, use the command `git worktree add ../vatty-[slug]-wt -b experiment/[slug]` to generate a dedicated directory and branch. This keeps your main branch pristine during architecture experiments and feature isolation.

Why use git worktree for branch management instead of standard branching?

Git worktree provides isolated experimental environments by creating separate working directories for each branch. This prevents main branch contamination during validation workflows, ensuring your primary codebase remains pristine while testing features independently.

What is the best way to manage the git worktree lifecycle and prevent clutter?

Managing the git worktree lifecycle involves enforcing branch naming conventions, applying lifecycle rules, and executing automatic cleanup. You can list, create, and remove worktrees systematically to prevent directory drift and clutter accumulation.

Can I enforce branch naming conventions and cleanup rules for git worktrees?

Yes, you can enforce branch naming conventions and cleanup rules for git worktrees. The automation applies safety checks and lifecycle rules to ensure experimental branches follow defined formats and are removed properly after pre-merge validation.

When do I need an isolated worktree for pre-merge validation workflows?

You need an isolated worktree for pre-merge validation when your main branch must remain pristine. It allows you to run architecture experiments and test features in a separate directory without risking contamination of the primary codebase.

Does git worktree work for architecture experiments without affecting the main branch?

Yes, git worktree works for architecture experiments by creating an isolated working directory linked to a dedicated experimental branch. This ensures all testing and validation occur separately, keeping the main branch completely uncontaminated.