Using git worktrees

From mkurman/zorai · View interactive version

Using git worktrees is an AI agent skill from the GitHub repository mkurman/zorai. Use when starting feature work that needs isolation from current workspace or before executing implementation plans - creates isolated git worktrees with smart directory selection and safety verification

How to use this skill

Skill file

-----|

| .worktrees/ exists | Use it (verify ignored) |

| worktrees/ exists | Use it (verify ignored) |

| Both exist | Use .worktrees/ |

| Neither exists | Check CLAUDE.md → Ask user |

| Directory not ignored | Add to .gitignore + commit |

| Tests fail during baseline | Report failures + ask |

| No package.json/Cargo.toml | Skip dependency install |

Common Mistakes

Skipping ignore verification

Assuming directory location

Proceeding with failing tests

Hardcoding setup commands

Example Workflow

You: I'm using the using-git-worktrees skill to set up an isolated workspace.

[Check .worktrees/ - exists]
[Verify ignored - git check-ignore confirms .worktrees/ is ignored]
[Create worktree: git worktree add .worktrees/auth -b feature/auth]
[Run npm install]
[Run npm test - 47 passing]

Worktree ready at /Users/jesse/myproject/.worktrees/auth
Tests passing (47 tests, 0 failures)
Ready to implement auth feature

Red Flags

Never:

Always:

Integration

Called by:

Pairs with:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.