AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Worktree

skill-enderyildirim-claude-skills-worktree · by enderyildirim

Isolate parallel, independent tasks in separate git worktrees so they never overwrite each other — each task gets its own working directory and branch. Use when juggling multiple unrelated changes at once, or when the user says 'work on this in parallel', 'spin up a worktree', 'isolate this task'. Usage: /worktree [create <task> | list | remove <task> | clean]

No reviews yet
0 installs
10 views
0.0% view→install

Install

$ agentstack add skill-enderyildirim-claude-skills-worktree

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-enderyildirim-claude-skills-worktree)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
1mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Worktree? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Worktree — Isolate Parallel Tasks

Git worktrees let one repository have multiple working directories checked out at once, each on its own branch. This is the clean way to work on several independent tasks in parallel: changes in one never touch another, no stashing, no branch-switching churn, no half-finished edits bleeding across tasks.

Use this when you have multiple unrelated changes in flight (feature A, bugfix B, experiment C) and they must stay isolated.

Conventions

  • Location: worktrees live in a sibling directory ../-worktrees/ — outside the main checkout so they never nest inside it, never get caught by its .gitignore, and never confuse tooling.
  • Branch per task: each worktree is on its own branch named `, created off the repo's base branch (read it from CLAUDE.md; fall back to the default branch from git symbolic-ref refs/remotes/origin/HEAD`).
  • Task slug: short kebab-case derived from the task (e.g. "fix login redirect" → fix-login-redirect).
  • One branch, one worktree: git refuses to check out the same branch in two worktrees — lean on that as the anti-overwrite guarantee.

Process

First read the target project's CLAUDE.md for the base/PR branch convention. Then dispatch on the argument:

create (default action)

  1. Resolve the repo root: git rev-parse --show-toplevel and its name.
  2. Resolve the base branch (CLAUDE.md convention → else git remote show origin default).
  3. Slugify ``.
  4. Create the worktree on a fresh branch off the up-to-date base:

``bash git fetch origin --quiet git worktree add ../-worktrees/ -b origin/ ` If the branch already exists, drop -b` and check it out instead.

  1. Report the absolute path and tell the user how to enter it: cd — and that they can open a separate Claude Code session there so each task has its own isolated context.

list

Run git worktree list and present each worktree with its branch and a one-line status (clean / N uncommitted files via git -C status --short). Flag any whose branch is already merged into base as safe to remove.

remove

  1. Check the worktree is clean (git -C status --short). If dirty, stop and warn — show the uncommitted changes, ask whether to commit, stash, or discard before removing. Never silently throw away work.
  2. git worktree remove ../-worktrees/ (add --force only after explicit user confirmation).
  3. Offer to delete the branch if it's fully merged: git branch -d .

clean

Run git worktree prune to clear stale administrative entries (worktrees whose directories were deleted manually), then list the survivors. Identify merged-branch worktrees and offer to remove them in a batch after confirmation.

Parallel agents

For parallel work driven by Claude itself rather than separate human sessions, the Agent tool's isolation: "worktree" option runs each subagent in its own throwaway worktree — same isolation guarantee, auto-cleaned. Mention this when the user wants Claude to fan out edits across tasks concurrently rather than manage long-lived worktrees by hand.

Rules

  • Never overwrite uncommitted work. Before any remove or --force, surface dirty state and get a decision. This is the whole point of the skill.
  • Keep worktrees outside the main checkout — always the sibling ../-worktrees/ dir, never a subdir of the repo.
  • One task = one branch = one worktree. Don't reuse a branch across worktrees; don't pile unrelated changes into one worktree.
  • Branch off an up-to-date base — fetch before creating so parallel tasks don't diverge from a stale point.
  • Be project-agnostic — detect repo name, root, and base branch dynamically; never hardcode paths.
  • Show before destroying — list what will be removed and confirm before deleting worktrees or branches.

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.