About creating-worktrees
A development skill for creating Git worktrees from existing or new branches. It handles repository-specific exclusion and optional CodeGraph setup, then reports the resulting state.
Key features
- 01Create a worktree from an existing branch
- 02Create a branch and worktree together
- 03Record .worktrees/ in Git’s local excludes
- 04Run CodeGraph init when applicable
- 05Report path and setup status
Use cases
- 01Create an isolated workspace for a task
- 02Start work on a new branch in a separate directory
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ darknesskiller/ skills --skill creating-worktreesAfter installing, type/creating-worktreesin Claude Code to confirm it loaded.
Bundled filesagents/openai.yaml
Details
From the project READMECreating Worktrees
Steps
- Find repo root:
git rev-parse --show-toplevel. - Get branch or task name; ask once if missing.
- Sanitize slug: replace
/, spaces, unusual chars with-. - Add
.worktrees/to$(git rev-parse --git-path info/exclude)if missing. - Create: existing branch →
git worktree add <path> <branch>; new branch →git worktree add -b <branch> <path>. codegraph init <path>only when source has.codegraph/or user asks. ElseCodeGraph: not applicable.- Report path, branch, exclude status, CodeGraph result.
Output
End with a short report covering Report path/branch, Sanitized slug, Worktree exists, Exclusion, and CodeGraph status.
Completion: worktree exists, branch correct, exclusion recorded, CodeGraph reported.
Comments
Markdown supported