using-git-worktrees

Creates isolated git worktree workspaces with native tool detection and baseline test verification.

Updated Aug 1, 2026
One-click install
npx skills add https://github.com/siegenthalerroger/.llmctl-marketplace --skill using-git-worktrees-siegenthalerroger
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/siegenthalerroger/.llmctl-marketplace/tree/main/plugins/llmctl-workflow-0.2.1/skills/using-git-worktrees
Command: npx skills add https://github.com/siegenthalerroger/.llmctl-marketplace --skill using-git-worktrees-siegenthalerroger

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Feature work done directly in your main checkout risks polluting your current branch and mixing unrelated changes. This Skill ensures every implementation task starts in an isolated workspace, using your platform's native worktree tools when available and falling back to manual git worktrees otherwise. ## Core Features & Use Cases - Isolation Detection: Checks whether you are already inside a linked worktree or a git submodule before creating anything, avoiding duplicate or phantom workspaces. - Native Tool Preference: Uses harness-provided worktree tools (e.g. EnterWorktree, /worktree commands) first, falling back to git worktree add only when no native tool exists. - Safe Directory Handling: Selects .worktrees/ or worktrees/ directories, verifies they are git-ignored, and commits a .gitignore fix if not. - Use Case: Before implementing a new feature branch, the Skill sets up an isolated worktree, installs project dependencies (npm, cargo, pip, go), and runs the test suite to confirm a clean baseline. ## Quick Start Set up an isolated git worktree for my new feature branch and verify the project tests pass before I start implementing.

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 workspace with git worktree?▼

Run `git worktree add <path> -b <branch-name>` to create a linked worktree on a new branch. The Skill automates this by choosing a safe directory, verifying it is git-ignored, and switching into the new workspace.

How do I check if I am already inside a git worktree?▼

Compare `git rev-parse --git-dir` with `git rev-parse --git-common-dir`. If the resolved paths differ, you are in a linked worktree; also check `git rev-parse --show-superproject-working-tree` to rule out being in a submodule.

Should I use git worktree add or a native worktree tool?▼

Prefer a native tool such as EnterWorktree or a /worktree command when your platform provides one, since it manages placement, branching, and cleanup. Use manual `git worktree add` only as a fallback when no native tool exists.

Why must the worktree directory be in .gitignore?▼

If the worktree directory is not ignored, its entire contents can be accidentally committed into the repository. The Skill runs `git check-ignore` and commits a .gitignore update before creating the worktree if needed.

What happens if git worktree creation fails due to sandbox permissions?▼

When `git worktree add` fails with a permission error, the Skill reports the sandbox denial and continues working in the current directory, running dependency setup and baseline tests in place.