Skip to content
Back to skills

Worktree

ASecurity

Manage git worktrees for parallel work on multiple branches simultaneously. Use when you need to work on two features at once without stashing or branch-switching.

  • 11 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added November 7, 2026
ai-agentsbashgit

Security analysis

A100/100

Scanned November 7, 2026

npx -y skills add brain-bootstrap/claude-code-brain-bootstrap --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/brain-bootstrap-worktree/badge)](https://www.skillsdirectory.com/skills/brain-bootstrap-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: Manage git worktrees for parallel work on multiple branches simultaneously. Use when you need to work on two features at once without stashing or branch-switching.
---

# Worktree Skill

Manage git worktrees for parallel, isolated work.

## When to use
- Need to review a PR while working on a feature
- Running a long test suite on one branch while developing on another
- Comparing behavior between two branches side-by-side
- Agent team work where each agent operates on a separate branch

## Create a worktree
```bash
# Create a worktree for an existing branch
git worktree add ../project-feature feature/my-feature

# Create a worktree for a new branch
git worktree add -b feature/new-thing ../project-new-thing main
```

## List active worktrees
```bash
git worktree list
```

## Remove a worktree (when done)
```bash
# 1. Confirm the work is committed or merged
# 2. Remove the worktree
git worktree remove ../project-feature

# Force remove if needed (work is intentionally discarded)
git worktree remove --force ../project-feature
```

## Prune stale worktree references
```bash
git worktree prune
```

## Rules
- NEVER remove a worktree without confirming all work is committed
- Each worktree has its own working directory — changes don't bleed between them
- Worktrees share the same git history — commits on one branch are visible from all
- Name worktrees consistently: `../project-<branch-slug>`

## For agent team workflows
When spawning multiple subagents for parallel work:
1. Create one worktree per agent before spawning
2. Give each agent its worktree path as its working directory
3. After all agents finish, review each worktree's changes
4. Merge or cherry-pick as needed
5. Clean up all worktrees after merge

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.

View all in ai-agents →

Comments

Loading comments…

Newsletter

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