using-git-worktrees

Automate isolated git worktree setup with safety checks and project scaffolding.

2|Updated Apr 3, 2026
One-click install
npx skills add https://github.com/ingbyr/lzcode --skill using-git-worktrees-ingbyr
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/ingbyr/lzcode/tree/main/packages/desktop/src-tauri/lz-assets/skills/using-git-worktrees
Command: npx skills add https://github.com/ingbyr/lzcode --skill using-git-worktrees-ingbyr

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Git worktrees provide isolated workspaces sharing the same repository, enabling multi-branch development without switching contexts or polluting the main workspace. This skill helps teams start new features in isolation, ensuring safe directory selection and strong precautions before creating a worktree, reducing the risk of accidentally committing worktree contents.

Core Features & Use Cases

  • Directory prioritization: reuse existing .worktrees or worktrees when available; respect CLAUDE.md preferences; otherwise prompt the user for a location.
  • Safety verification: ensure the selected directory is ignored by gitignore to prevent accidental commits; provide steps if not ignored.
  • Project-aware creation: auto-detect project name, create proper path for local or global worktrees; run project setup; verify a clean baseline with tests.
  • Use case: starting a feature branch in a dedicated worktree so changes stay isolated from the main repo.

Quick Start

Ask the AI to set up an isolated git worktree following the priority rules and safety checks described.

Frequently Asked Questions about using-git-worktrees

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

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

Setting up an isolated git worktree involves detecting the project name, applying priority-based directory selection, verifying gitignore status, and scaffolding the environment for your specific runtime to ensure a clean baseline.

How do I prevent accidental commits when using git worktrees?

To prevent accidental commits in git worktrees, you need a safety verification step that ensures the selected directory is ignored by gitignore before proceeding with the workspace creation and project scaffolding.

Can I automatically scaffold a Node.js or Rust project in a new git worktree?

Yes, you can automatically scaffold projects for common runtimes like Node.js, Rust, Python, and Go within a new git worktree, running tests afterwards to verify a clean baseline before starting feature development.

What is the best way to manage multiple worktree paths for different repositories?

Managing multiple worktree paths effectively requires a priority-based directory selection system that reuses existing local .worktrees directories, respects global configurations, and prompts for a location only when necessary.

Does git worktree isolation work without switching contexts in the main workspace?

Yes, git worktree isolation provides separate workspaces sharing the same repository, enabling multi-branch development without switching contexts or polluting the main workspace with uncommitted changes.