Skip to content
Back to skills

Worktree

ASecurity

Create a git worktree and prime the development environment for a new feature or refactor. Use when starting isolated feature work or needing a separate working copy.

  • 45 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added February 7, 2026
developmentbashgit

Works with

  • claude code

Security analysis

A92/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro shows the line behind each finding and how to fix it

Scanned September 24, 2026

npx -y skills add incubateur-ademe/benefriches --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/incubateur-ademe-worktree/badge)](https://www.skillsdirectory.com/skills/incubateur-ademe-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
effort: low
model: haiku
description: Create a git worktree and prime the development environment for a new feature or refactor. Use when starting isolated feature work or needing a separate working copy.
allowed-tools: Bash
user-invocable: true
---

# Create Git Worktree

Create a new git worktree for isolated feature development.

## Instructions

1. Parse the branch name from arguments
2. Run the worktree creation script
3. Report the result and next steps

## Execution

The script always creates a new branch from current HEAD, places the worktree under `.claude/worktrees/<name>` (gitignored, so it never pollutes `git status`/diff/search), and primes it (pnpm install, shared build, env files):

```bash
scripts/create-worktree.sh <branch-name>
```

### Branch Naming Convention

If the user provides just a feature name without a prefix, add the appropriate prefix:
- Features: `feat/<name>` (default)
- Refactors: `refactor/<name>` (if user mentions "refactor")
- Fixes: `fix/<name>` (if user mentions "fix" or "bug")
- Chores: `chore/<name>` (if user mentions "chore")

### Examples

| User Input | Branch Name |
|------------|-------------|
| `/worktree new-feature` | `feat/new-feature` |
| `/worktree refactor auth` | `refactor/auth` |
| `/worktree fix/login-bug` | `fix/login-bug` (keep as-is) |
| `/worktree feat/my-thing` | `feat/my-thing` (keep as-is) |

## After Execution

Tell the user:
1. The worktree location
2. How to navigate to it: `cd <worktree-path>`
3. Remind them to start a new agent session (Claude Code or Codex) in that directory for isolated work

## Arguments

$ARGUMENTS

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…