using-git-worktrees

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

Updated Aug 22, 2026
One-click install
npx skills add https://github.com/falentio/cimi --skill using-git-worktrees-falentio
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/falentio/cimi/tree/main/.agents/skills/skills/using-git-worktrees
Command: npx skills add https://github.com/falentio/cimi --skill using-git-worktrees-falentio

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 ensures every implementation task begins in an isolated workspace, detecting existing isolation first and falling back to manual git worktrees only when no native tool exists. ## Core Features & Use Cases - Isolation Detection: Checks 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 (e.g., EnterWorktree) when available, falling back to git worktree add only when necessary. - 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: Before implementing a new API endpoint, run this Skill to spin up an isolated worktree, install dependencies, and confirm the test suite passes so pre-existing failures are not confused with new bugs. ## Quick Start Set up an isolated git worktree for my next feature branch and verify the baseline tests pass before I start coding.

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?

Run git worktree add with a target path and new branch name, such as placing it in a .worktrees directory at the project root. Verify the directory is listed in .gitignore first so worktree contents never get committed to the repository.

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 they differ, you are in a linked worktree. Also run git rev-parse --show-superproject-working-tree to rule out being inside a submodule, which shows the same difference.

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

Prefer a native worktree tool such as EnterWorktree or a /worktree command when one is available, since it handles directory placement, branch creation, and cleanup automatically. Use git worktree add only as a fallback when no native tool exists.

Why does git worktree add fail with a permission error?

A sandboxed environment can block worktree creation with a permission denial. In that case, report the sandbox restriction and continue working in the current directory, running setup and baseline tests in place.

What should I do when baseline tests fail in a new worktree?

Report the failing tests and ask whether to proceed or investigate before writing any code. Proceeding without a clean baseline makes it impossible to distinguish pre-existing failures from bugs introduced by new changes.