worktree

Solid

Isolate risky or parallel file-mutating work in a git worktree so the main tree's uncommitted changes are never clobbered. For fan-out agents that edit files, throwaway experiments, or any change you may want to discard cleanly.

AI & Automation 22 stars 4 forks Updated yesterday MIT

Install

View on GitHub

Quality Score: 81/100

Stars 20%
45
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# Worktree Isolation <!-- routing-eval reads this line; it lives in the BODY so the always-on skill LISTING stays inside Claude Code's budget (1% of the context window) — an overflowing listing gets descriptions truncated or dropped, which strips the very keywords a match depends on. --> Trigger phrases: "worktree", "git worktree", "isolate the changes", "sandbox this work", "parallel file edits" One rule: **never let risky or parallel work run on top of uncommitted changes in the shared tree.** A git worktree gives a second working copy of the same repo on its own branch — you experiment or fan out agents there, and the main tree (with your in-progress edits) is physically untouched. Throw the worktree away and nothing you cared about is lost. > **Kit adaptation (local, .claude/):** this exists because verification/fan-out subagents have discarded a session's > **uncommitted** work by running a destructive git command over the shared tree. Those commands (`reset --hard`, > `clean -f`, `checkout -- .`, `restore`) are §4.5-gated — but the real fix is to not put them near unsaved work. > The Agent tool's `isolation: "worktree"` does this automatically for parallel mutating agents; reach for it there. ## When to isolate - **Fan-out that writes files** — two+ agents editing the same repo in parallel would collide; give each its own worktree. - **A throwaway experiment** — you might keep it or bin it; a worktree makes "bin it" a one-liner, not a `reset --hard`. - **A...

Details

Author
byerlikaya
Repository
byerlikaya/claude-starter-kit
Created
1 months ago
Last Updated
yesterday
Language
Shell
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Listed

worktree-isolation

Git worktree-based task isolation. Use when making changes that should not affect the main working tree until verified, or when running parallel development tasks that might conflict.

3 Updated 3 days ago
Silex-Research
AI & Automation Listed

worktree-workflow

Git worktree isolation via the EnterWorktree and ExitWorktree tools — creating a separate checkout on its own branch, working in it, then keeping or discarding it. Use ONLY when a worktree is explicitly requested, by the user or by project instructions (CLAUDE.md / memory). Triggers include worktree, EnterWorktree, ExitWorktree, isolated checkout, side branch. Once explicitly requested it fits work needing a second simultaneous checkout — a risky refactor that may be thrown away, a hotfix on a release branch while feature work continues in the main tree, or two implementations compared side by side — but none of those authorizes the tool on its own, without the explicit request. It does not cover parallelism in general — parallel sub-agents, parallel tool calls, and concurrent tasks are unrelated, and per-agent repo isolation is instead the Agent tool's isolation parameter set to "worktree" — nor an ordinary branch switch, a single-file experiment revertible with git checkout, or a non-git project.

6 Updated 1 weeks ago
pfangueiro
Code & Development Listed

using-git-worktrees

Use when work needs isolation from the current branch — long-running feature, risky refactor, parallel attempt. Creates and tracks a worktree without touching unrelated state.

3 Updated 1 weeks ago
felipemelendez