using-git-worktrees

Creates isolated git worktree workspaces for feature development with baseline test verification.

Updated May 8, 2026
One-click install
npx skills add https://github.com/afonsoft/EAF --skill using-git-worktrees-afonsoft
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/afonsoft/EAF/tree/main/.claude/skills/using-git-worktrees
Command: npx skills add https://github.com/afonsoft/EAF --skill using-git-worktrees-afonsoft

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Starting feature work directly in your main checkout risks polluting your current branch and mixing unrelated changes. This Skill sets up an isolated git worktree so feature work happens in a separate workspace without disturbing your existing state. ## Core Features & Use Cases - Isolation Detection: Detects whether you are already inside a linked worktree or a submodule before creating anything, preventing nested worktrees. - Native Tool Preference: Uses platform-native worktree tools when available and falls back to manual git worktree add only when no native tool exists. - Safe Directory Selection: Follows a priority order for worktree placement (existing .worktrees/, legacy global path, declared preference, default) and verifies the directory is git-ignored before creation. - Use Case: You are asked to implement a new EAF feature while your current branch has uncommitted work. The Skill detects your repo state, creates an isolated worktree on a new branch, installs dependencies, and runs the test suite to confirm a clean baseline before coding begins. ## Quick Start Set up an isolated git worktree for my new feature branch and verify the project tests pass before I start working.

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 with a target path and a new branch name, for example git worktree add .worktrees/my-feature -b my-feature. The Skill automates this after checking for existing isolation and verifying the directory is git-ignored.

What is the difference between a git worktree and a git submodule?▼

A linked worktree shares the same repository's git common directory while a submodule is an independent repository nested inside another. The Skill distinguishes them using git rev-parse --show-superproject-working-tree before deciding whether isolation already exists.

Why should the worktree directory be added to gitignore?▼

Project-local worktree directories like .worktrees must be ignored so their contents are never tracked or committed into the repository. The Skill runs git check-ignore before creation and commits a gitignore update if the directory is not ignored.

What happens if git worktree add fails with a permission error?▼

A permission error usually means the sandbox blocked worktree creation. The Skill reports the sandbox denial, then continues working in the current directory and runs setup and baseline tests in place.

Should I run tests before starting work in a new worktree?▼

Yes, running the project's test suite first establishes a clean baseline so new failures can be attributed to your changes. If baseline tests fail, the Skill reports the failures and asks whether to proceed or investigate.