git-worktrees

Create and manage git worktrees for parallel feature development.

3|Updated Oct 25, 2025
One-click install
npx skills add https://github.com/codekiln/langstar --skill git-worktrees-codekiln
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-worktrees
Source: https://github.com/codekiln/langstar/tree/main/.claude/skills/git-worktrees
Command: npx skills add https://github.com/codekiln/langstar --skill git-worktrees-codekiln

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill simplifies managing multiple Git branches and contexts for parallel feature development. It addresses the complexity of hierarchical issue relationships and ensures proper branch hygiene, allowing you to work on several tasks simultaneously without context switching.

Core Features & Use Cases

  • Parallel Development: Create isolated working directories for multiple branches, eliminating context switching overhead and boosting productivity.
  • Hierarchical Branching: Guides the creation of worktrees for sub-issues that correctly branch from parent issue feature branches, maintaining a clean PR flow.
  • Automated Cleanup: Streamlines the removal of merged worktrees and pruning of stale references, keeping your workspace tidy.
  • Use Case: When working on a sub-issue (e.g., "Implement JWT") that depends on a parent feature branch (e.g., "Add Authentication"), use this skill to create a new worktree that correctly branches from the parent's feature branch.

Quick Start

Create a new git worktree for issue #130, titled "Add user authentication", branching from the release/v0.2.0 branch.

Frequently Asked Questions about git-worktrees

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

FAQPage Schema
How do I work on multiple Git branches simultaneously without constant switching?

Git worktrees create isolated working directories for each branch, letting you develop multiple features in parallel. Each worktree is a separate checkout of your repository, eliminating context switching overhead and keeping your workspace organized.

How do I create a worktree for a sub-issue that branches from a parent feature branch?

Use git worktree add to create a new worktree that branches from the parent issue's feature branch instead of main. This maintains hierarchical relationships in your issue workflow and ensures sub-issue work builds correctly on parent dependencies.

What's the best way to keep my worktrees clean and remove merged branches?

Remove worktrees with git worktree remove after merging their PRs, then run git worktree prune to clean up stale references. Automated cleanup prevents dead worktrees from cluttering your workspace and maintains branch hygiene.

Can I use git worktrees with a hierarchical issue workflow?

Yes. Git worktrees work seamlessly with hierarchical issue structures—top-level issues, sub-issues, milestones, and parent-child relationships. The Skill enforces standardized branch naming and maintains worktrees under a wip/ directory to support this workflow.

Do I need to follow specific branch naming conventions when creating worktrees?

Yes, this Skill enforces standardized branch naming conventions tied to issue hierarchies. Following these conventions ensures consistency, reduces naming conflicts, and integrates worktree creation with your issue-driven workflow automatically.

What happens to my worktrees after I merge a pull request?

After a PR merges, remove the worktree explicitly and prune stale Git references. The Skill streamlines this cleanup process to keep your repository references current and prevent orphaned worktrees from accumulating.