worktree

Manage git worktrees to run parallel agent branches in sibling directories.

Updated Feb 28, 2026
One-click install
npx skills add https://github.com/heman1033p-create/cv-v2-kongphop --skill worktree-heman1033p-create
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: worktree
Source: https://github.com/heman1033p-create/cv-v2-kongphop/tree/main/.gemini/skills/worktree
Command: npx skills add https://github.com/heman1033p-create/cv-v2-kongphop --skill worktree-heman1033p-create

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Working on multiple branches or running parallel AI agents in a single repository causes constant branch switching, stashing, and merge conflicts. This Skill manages git worktrees so each agent or task gets its own directory and branch without disturbing the main workspace. ## Core Features & Use Cases - List Worktrees: Run /worktree to see all registered worktrees with their branches and commits. - Create Agent Worktrees: Run /worktree new to create a sibling directory (e.g., repo.wt-1) with a dedicated agents/N branch, avoiding VS Code indexing issues from nested worktrees. - Path Lookup & Removal: Run /worktree N to get a worktree's path and VS Code open command, or /worktree remove N to clean it up with optional branch deletion. - Use Case: You want three AI agents working on separate features simultaneously. Use /worktree new three times to create isolated directories, open each in its own VS Code window, and sync results back via pull requests to main. ## Quick Start Ask the assistant to create a new worktree for parallel agent work by saying "/worktree new" and it will set up a sibling directory with its own branch.

Frequently Asked Questions about worktree

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a git worktree for parallel development?▼

Run /worktree new to create a sibling directory named repo.wt-N with a new agents/N branch. The command finds the next available number, registers the worktree with git, and displays the path plus a VS Code open command.

How do I list all git worktrees in my repository?▼

Run /worktree with no arguments, or /worktree list, to execute git worktree list. The output shows each worktree path alongside its commit hash and checked-out branch.

Why are worktrees created as sibling directories instead of nested?▼

Sibling directories avoid VS Code indexing issues that occur when worktrees are nested inside the main repository. Each worktree like repo.wt-1 sits next to the main repo and can be opened as a separate workspace.

How do I remove a git worktree and its branch?▼

Run /worktree remove N to unregister and delete the repo.wt-N directory using git worktree remove. The Skill asks for confirmation before also deleting the associated agents/N branch with git branch -d.

Can multiple AI agents work in the same repository at once?▼

Yes, each agent gets its own worktree directory and agents/N branch, so they work in isolation without conflicts. Results are synced back to main through pull requests rather than force pushes.