worktree

Creates git worktrees and orchestrates parallel subagents for concurrent feature development.

Updated May 3, 2026
One-click install
npx skills add https://github.com/Claudfather/clauDNA --skill worktree-claudfather
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: worktree
Source: https://github.com/Claudfather/clauDNA/tree/main/skills/worktree
Command: npx skills add https://github.com/Claudfather/clauDNA --skill worktree-claudfather

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Working on multiple features or branches simultaneously forces constant stashing, context switching, and merge conflicts in a single checkout. This Skill creates isolated git worktrees and delegates work to parallel subagents so multiple branches progress independently without interfering with your main workspace. ## Core Features & Use Cases - Worktree Creation and Management: Creates worktrees as sibling directories (<repo>-worktrees/<branch>/), lists current state, and handles new or existing branches with absolute paths. - Parallel Subagent Orchestration: Launches background general-purpose Task agents — one per worktree — with complete task context, bootstrap instructions, and monitoring via TaskOutput. - Safe Merge and Cleanup: Enforces the correct order of removing worktrees before merging PRs, rebasing conflicting branches on updated main, and returning to a clean main branch. - Use Case: You have three independent features from a sprint plan. The Skill creates three worktrees, launches three subagents that each bootstrap dependencies, implement, test, commit, and open PRs, then merges them sequentially after cleanup. ## Quick Start Ask the AI to create a separate git worktree for each task in your plan and run parallel subagents to implement, test, and open a pull request for each one.

Frequently Asked Questions about worktree

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

FAQPage Schema
How do I run multiple Claude sessions on different git branches in parallel?

Create one git worktree per branch as a sibling directory of your repo, then launch a background subagent per worktree with the full task description inlined. Each subagent bootstraps dependencies, implements, tests, commits, and opens its own PR independently.

How do I create a git worktree for a new feature branch?

Run `git worktree add <absolute-path> -b <branch>` after creating the parent directory with `mkdir -p`. Use the convention `<repo-root>-worktrees/<branch>/` as a sibling of the repo, never inside it, and always use absolute paths.

Why does gh pr merge --delete-branch fail with worktrees?

Git cannot delete a branch that is still checked out in a worktree. Remove every worktree with `git worktree remove` and run `git worktree prune` before merging the PR with `--delete-branch`.

Why do imports or tests fail inside a new git worktree?

Worktrees only contain git-tracked files, so venvs, node_modules, and .env files are missing. Copy .env from the main repo, then create a fresh venv or run npm install before executing tests.

What subagent type should I use for worktree tasks?

Use `subagent_type: "general-purpose"` so the agent has Bash, Read, Edit, Write, Grep, and Glob access. Other types fail silently, and each prompt must inline the complete task description since subagents have no conversation history.