agentsclimarketplace

Worktree new

Skill Enverge-Labs/skills/skills/worktree-new

Agent skills for Claude Code and other coding agents

Install
npx -y skills add Enverge-Labs/skills --skill worktree-new

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Git worktree conventions for isolated parallel feature work. Use when starting a new coding task, feature, bugfix, or PR-review in a git repository — anytime work should get its own branch and worktree instead of touching the main checkout, or when the user asks to work in / create / list / remove a worktree. Applies to whatever repository Claude is currently in.

SKILL.md

2.8 KB, 645 tokens by cl100k_base, as published. Nobody here has run it

Git worktrees

Isolate each task in its own worktree so the main checkout stays on the default branch and parallel work never collides.

First: find the repo and defer to a local doc

Run these before anything else — they resolve the repo you're actually in (never hardcode a path):

ROOT="$(git rev-parse --show-toplevel)" || { echo "not a git repo"; exit 1; }
DEFAULT_BRANCH="$(git -C "$ROOT" symbolic-ref --quiet --short refs/remotes/origin/HEAD 2>/dev/null | sed 's@^origin/@@' || echo main)"

If $ROOT/WORKTREES.md exists, read it and follow it instead — the repo's own doc is the source of truth and may override the conventions below. Only fall back to this skill's defaults when the repo has no WORKTREES.md.

Naming (default convention)

ItemPatternExample
Directory.claude/worktrees/<slug>/.claude/worktrees/add-start-timestamp
Branchworktree-<slug>worktree-add-start-timestamp

<slug> = kebab-case task title (lowercase, hyphens).

Create

From an up-to-date default branch:

git -C "$ROOT" fetch origin
SLUG="my-feature-name"
git -C "$ROOT" worktree add -b "worktree-${SLUG}" ".claude/worktrees/${SLUG}" "origin/${DEFAULT_BRANCH}"
cd "$ROOT/.claude/worktrees/${SLUG}"

If the branch already exists, drop -b and point at it:

git -C "$ROOT" worktree add ".claude/worktrees/${SLUG}" "worktree-${SLUG}"

Ship

git add -A && git commit -m "…"
git push -u origin HEAD
gh pr create --title "…" --body "…"

Base branch is usually the repo default. Match existing PR titles/bodies in the repo.

List / remove

git -C "$ROOT" worktree list
git -C "$ROOT" worktree remove ".claude/worktrees/${SLUG}"   # after the branch is merged
git -C "$ROOT" branch -d "worktree-${SLUG}"                  # if not auto-deleted
git -C "$ROOT" worktree prune

Notes

  • To tear a worktree down by PR state once the task ships, see the companion worktree-cleanup skill.
  • Always run git worktree against $ROOT; paths are relative to it.
  • Worktrees get their own .git file pointing at the shared object store; tracked files like .claude/settings.json and .vscode/settings.json are checked out normally.
  • Sandboxed environments may block worktree creation under .claude/ — retry with full filesystem/git access if checkout fails.

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.