worktrees

Create, reuse, and clean up git worktree lanes for development tasks.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/hack-ink/codexlab --skill worktrees-hack-ink
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: worktrees
Source: https://github.com/hack-ink/codexlab/tree/main/.codex/skills/worktrees
Command: npx skills add https://github.com/hack-ink/codexlab --skill worktrees-hack-ink

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill coordinates and governs the use of git worktree lanes to separate development tasks, enabling safe isolation, predictable lane lifecycle, and clear cleanup without impacting main branches.

Core Features & Use Cases

  • Lane provisioning and reuse: creates or reuses a dedicated .worktrees/<lane> lane for each non-read-only task.
  • Isolated development context: keeps changes separated across lanes and ensures clean diffs.
  • Automatic cleanup and reconciliation: handles closeout of lanes and removes lane state when work is complete.
  • Safety and conventions: ensures worktrees are ignored by default and lane naming remains predictable.

Quick Start

Create or reuse a dedicated worktree lane (e.g., .worktrees/<lane>) and begin work in that lane using the repository's bootstrap guidance.

Frequently Asked Questions about worktrees

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

FAQPage Schema
How do I manage git worktrees for isolated development tasks?

To manage git worktrees for isolated development tasks, you can create or reuse a dedicated .worktrees/<lane> directory for each task. This ensures changes are separated across lanes and provides clean diffs without impacting main branches.

What is a worktree lane and when do I need it for branch management?

A worktree lane is a predictable, isolated .worktrees/<lane> directory used to separate non-read-only development tasks. You need it when starting, resuming, or cleaning up work across multiple branches to ensure safe isolation and predictable lane lifecycle.

How do I clean up git worktrees after finishing a development task?

To clean up git worktrees after finishing a development task, the workflow handles automatic closeout of lanes and removes lane state when work is complete. This ensures clean reconciliation without leaving residual branch state.

Does git worktree lane management work without affecting my main branch?

Yes, git worktree lane management works without affecting your main branch by keeping changes separated across lanes. It enforces isolation rules and ensures worktrees are ignored by default to maintain clear cleanup and safe development.

What is the best way to switch between multiple git branches without stashing changes?

The best way to switch between multiple git branches without stashing is using a worktree lane model. It provisions a dedicated .worktrees/<lane> directory for each task, keeping isolated development contexts separate and ensuring clean diffs.