Skip to content
Back to skills

Worktree

ASecurity

Create a work branch in a ready-to-use git worktree. The normal way to start a branch, so as not to cross another session in the main tree.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 21, 2026
developmentbashgit

Security analysis

A100/100

Scanned October 21, 2026

npx -y skills add antoine-tena/kiln --skill worktree --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Worktree?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Worktree
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/antoine-tena-worktree/badge)](https://www.skillsdirectory.com/skills/antoine-tena-worktree)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: worktree
description: Create a work branch in a ready-to-use git worktree. The normal way to start a branch, so as not to cross another session in the main tree.
argument-hint: "<type/branch-name>"
---

Branch asked for: `$ARGUMENTS` (`feat/…`, `fix/…`, `chore/…`, like the repo's history). Without
an argument, propose one from the task.

1. Find the root of the repo (`git rev-parse --show-toplevel` of the main tree) and its
   integration branch: the one the project's `CLAUDE.md` names, otherwise `develop` if it exists
   on `origin`, otherwise the default branch (`git symbolic-ref refs/remotes/origin/HEAD`).
2. From the root, never switching the branch of the main tree: `git fetch -q origin
   <integration>`, then `git worktree add --no-track .claude/worktrees/<name> -b <branch>
   origin/<integration>` (`<name>` = the branch with `/` replaced by `-`). Without `--no-track`,
   the branch would track `origin/<integration>`: a bare `git push` refused, a `git pull` that
   pulls the integration branch. If the branch already exists, attach it without `-b`. Check
   that `.claude/worktrees/` is ignored by git; otherwise add it to `.git/info/exclude`.
3. Prepare the worktree: `bash "${CLAUDE_PLUGIN_ROOT}/scripts/prepare-worktree.sh" <path of the
   worktree>` (copies the ignored `.env*` files of the main tree, installs the dependencies of
   each `pnpm-lock.yaml` / `package-lock.json`). If the repo also provides
   `.claude/worktree-setup.sh`, run it next with the same argument.
4. Then work only in that worktree (absolute paths) and give its path.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.