hug-worktree

Creates isolated Git worktrees for branch-worthy work using the hug CLI ritual.

2|1|Updated Oct 10, 2025
One-click install
npx skills add https://github.com/elifarley/hug-scm --skill hug-worktree-elifarley
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hug-worktree
Source: https://github.com/elifarley/hug-scm/tree/main/docs/skills/hug-worktree
Command: npx skills add https://github.com/elifarley/hug-scm --skill hug-worktree-elifarley

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Starting feature or bugfix work directly in the main checkout risks mixing unrelated changes and losing track of branches. This Skill enforces a worktree-first ritual so every branch-worthy task begins in a fresh, isolated worktree before any other action. ## Core Features & Use Cases - Worktree-first provisioning: Creates and enters a new worktree with hug wtc <branch> --base origin/main -y before any work begins. - Safety guardrails: Hard-blocks raw git worktree usage and explicit paths, keeping all work inside the sibling <repo>.WT.<branch> directory. - Clean teardown: Removes the worktree after merge with hug wtdel <branch> --force, optionally deleting the branch with --with-branch. - Use Case: When asked to implement a new feature, the assistant provisions a dedicated worktree off origin/main, does all edits there, and cleans up after the branch is merged. ## Quick Start Ask the assistant to start a new feature branch using the hug worktree workflow, and it will create the worktree, work inside it, and clean up after merging.

Frequently Asked Questions about hug-worktree

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

FAQPage Schema
How do I start a new feature branch in a Git worktree with hug?

Run `hug -C <repo> wtc <branch> --base origin/main -y` to create the worktree, then cd into the sibling `<repo>.WT.<branch>` directory and do all work there. The full ritual is documented in `hug help :worktree`.

How do I delete a Git worktree after merging a branch?

Use `hug -C <repo> wtdel <branch> --force` to remove the worktree after the branch is merged. Append `--with-branch` if you also want to delete the branch itself.

Can I use git worktree commands directly with this workflow?

No, raw `git worktree` commands are hard-blocked by this workflow. All worktree operations must go through hug commands like `hug wtc`, `hug wtl`, and `hug wtdel` to keep the ritual consistent.

When should I skip creating a worktree for a task?

The worktree-first rule applies to branch-worthy work such as features, bugfixes, refactors, and multi-step tasks. The full criteria for when to skip are defined in `hug help :worktree`, which is the single source of truth.

Why does hug wtc reject an explicit worktree path?

The workflow forbids passing explicit paths or using a `.worktrees/` directory. Worktrees are always created as sibling directories named `<repo>.WT.<branch>` so their location stays predictable and cleanup stays reliable.