Create worktree

From dlt-hub/dlt · View interactive version

Create worktree is an AI agent skill from the GitHub repository dlt-hub/dlt. Create or reuse a git worktree for a pull request or branch so reviews and work happen in isolation

How to use this skill

Skill file

Git Worktree

Set up an isolated git worktree.

Parse $ARGUMENTS to extract:

Steps

1. Determine worktree path

The worktree path is: <repo-root>/.worktrees/<name>

For example, if the repo root is /home/user/src/dlt and the name is review-pr-3584, the worktree path is /home/user/src/dlt/.worktrees/review-pr-3584.

Create the .worktrees directory if it does not exist:

mkdir -p <repo-root>/.worktrees

2. Create or reuse the worktree

Check if a worktree already exists at that path:

git worktree list

3. Switch cwd

cd <worktree-path>

Then verify the switch took effect:

pwd

If pwd does not show the worktree path, stop with an error — the cwd did not persist.

4. Report

Worktree ready: <worktree-path>
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.