# New Worktree

> Create a new git worktree for the task the user described.

- Skill: `steph-dove/new-worktree` (Agent Skill)
- Install (CLI): `npx skillmds@latest add steph-dove/new-worktree`
- Raw SKILL.md: https://api.skillmd.com/api/skills/steph-dove/new-worktree/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Productivity
- Author: steph-dove (https://skillmd.com/u/steph-dove)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/steph-dove/new-worktree

---


Create a new git worktree for the task the user described.

1. Read CLAUDE.md to understand the project structure and branching conventions.
2. Create a short, descriptive branch name based on the task (e.g. `fix/login-redirect`, `feat/add-search`).
3. Take the current repository's folder name (you already know the working directory — don't compute it with a shell substitution like `$(basename $PWD)`, which isn't portable to Windows shells), then run `git worktree add ../<repo-folder>-<branch-name> -b <branch-name> {{BASE_BRANCH}}` to create the worktree from the configured base branch (the trailing start-point keeps the new branch from inheriting whatever branch the user is currently checked out on).
4. Confirm the worktree was created successfully with `git worktree list`.
5. Tell the user the full path to the new worktree so they can open it.

Rules:
- Always branch from {{BASE_BRANCH}} unless told otherwise.
- Use lowercase kebab-case for branch names.
- Prefix with `fix/`, `feat/`, `chore/`, `docs/`, or `refactor/` as appropriate.
- Do not start work in the worktree — just create it and report the path.

## When NOT to use

- The user just wants a new branch in the current working tree (`git checkout -b`) — worktrees are for parallel checkouts, not branch creation alone.
- A worktree for the same branch already exists — surface the existing path; don't create a duplicate.
- The user is on a non-worktree-friendly hosting setup (some submodule-heavy repos break with worktrees) — flag the risk before creating.

