worktree

Manage per-change Git worktrees with a central registry and openspec naming.

4|1|Updated Jan 16, 2026
One-click install
npx skills add https://github.com/jankneumann/agentic-coding-tools --skill worktree-jankneumann
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: worktree
Source: https://github.com/jankneumann/agentic-coding-tools/tree/main/.agents/skills/worktree
Command: npx skills add https://github.com/jankneumann/agentic-coding-tools --skill worktree-jankneumann

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Coordinating per-change Git worktrees to isolate feature development, reduce merge conflicts, and keep main branches clean.

Core Features & Use Cases

  • Create and manage per-change worktrees with setup and teardown.
  • Track activity with heartbeats and a central registry.
  • Pin/unpin and garbage-collect stale or merged worktrees to reclaim space.

Quick Start

Run python3 scripts/worktree.py setup <change-id> to provision a dedicated worktree for your feature.

Frequently Asked Questions about worktree

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

FAQPage Schema
How do I isolate feature development from my main branch using Git worktrees?

Git worktrees isolate feature development by provisioning a dedicated working directory for each change. This Skill orchestrates setup and teardown, keeping your main branch clean and reducing merge conflicts during feature work.

How does a central registry help manage multiple Git worktrees?

A central registry tracks Git worktrees by storing their state and activity in a JSON file. This mechanism enables features like heartbeat monitoring, pinning, and garbage collection to reclaim space from stale or merged worktrees.

What is the best way to clean up stale or merged Git worktrees?

The best way to clean up stale Git worktrees is using the garbage collection command. It identifies and removes merged worktrees, reclaims disk space, and updates the central registry to ensure only active feature directories remain.

Can I apply a custom branch naming scheme when I setup a new Git worktree?

Yes, you can apply a custom branch naming scheme using openspec conventions and an optional agent ID suffix. The setup respects explicit branches and environment overrides to ensure consistent branch naming across tools.

Why do I need to pin a Git worktree in my feature workflow?

You need to pin a Git worktree to prevent it from being removed by garbage collection. Pinning protects active feature directories from automatic cleanup, ensuring your ongoing development work persists in the registry.

Does this worktree automation tool require external dependencies?

No, this worktree automation tool requires no external dependencies. It operates using standard Python scripts to manage your feature branches, allowing you to run the setup command directly to provision a dedicated worktree.