Skip to content
Back to skills

Create Worktree

ASecurity

Creates a git worktree with branch and copies environment files (.envrc, .mcp.json)

  • 8 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 25, 2026
ai-agentsbashgitapi

Works with

  • api
  • mcp

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned September 25, 2026

npx -y skills add dravr-ai/dravr-embacle --skill create-worktree --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Create Worktree?

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

Security grade badge for Create Worktree
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/dravr-ai-create-worktree/badge)](https://www.skillsdirectory.com/skills/dravr-ai-create-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: create-worktree
description: Creates a git worktree with branch and copies environment files (.envrc, .mcp.json)
argument-hint: [branch-name]
user-invocable: true
---

# Create Worktree Skill

**CLAUDE: When this skill is invoked with `/create-worktree <branch-name>`, immediately run:**
```bash
./.claude/skills/create-worktree/create-worktree.sh <branch-name>
```

## Purpose
Creates a new git worktree with a feature branch, automatically copying environment files that are not tracked in git.

## Usage
```bash
/create-worktree feature/my-new-feature
```

## What It Does
1. Creates a new git worktree at `../pierre_mcp_server-<branch-name>`
2. Creates a new branch with the specified name
3. Copies `.envrc` from main worktree
4. Copies `.mcp.json` if present
5. Runs `direnv allow` to activate the environment

## Commands

### Using the script directly:
```bash
./.claude/skills/create-worktree/create-worktree.sh <branch-name> [optional-path]

# Examples:
./.claude/skills/create-worktree/create-worktree.sh feature/new-api
./.claude/skills/create-worktree/create-worktree.sh fix/bug-123 /tmp/quick-fix
```

### Manual steps (if script unavailable):
```bash
BRANCH="feature/my-feature"
WORKTREE="../embacle-${BRANCH//\//-}"

git worktree add -b "$BRANCH" "$WORKTREE"
cp .envrc "$WORKTREE/"
cp .mcp.json "$WORKTREE/" 2>/dev/null || true
cd "$WORKTREE" && direnv allow
```

## Cleanup
When done with a worktree:
```bash
git worktree remove ../embacle-feature-my-feature
git branch -d feature/my-feature  # if merged
```

## Related Skills
- `finish-worktree` - Completes feature branch work with rebase and merge

Files in this skill

  • SKILL.md1.6 KB
  • create-worktree.sh1.5 KB

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.