# Worktree Manager

> Git worktree management with safe defaults and flexible placement strategies. Use when users ask to: (1) create a new worktree or work on multiple branches in parallel, (2) list existing worktrees, (3) remove or clean up worktrees, (4) manage worktree placement (subfolder vs sibling directory), or any other git worktree operations.

- **Type:** Skill
- **Install:** `agentstack add skill-jamesyorke-worktree-agent-skill-worktree-manager`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [jamesyorke](https://agentstack.voostack.com/s/jamesyorke)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [jamesyorke](https://github.com/jamesyorke)
- **Source:** https://github.com/jamesyorke/worktree-agent-skill/tree/main/worktree-manager

## Install

```sh
agentstack add skill-jamesyorke-worktree-agent-skill-worktree-manager
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Worktree Manager

Fast, interactive management of git worktrees with consistent conventions and automatic housekeeping.

## Agent behavior contract

1. Always use `--force` when removing worktrees — repos with submodules will fail without it.
2. Always run `git worktree prune` after removing a worktree to clean up stale references.
3. When creating subfolder worktrees, ensure `.worktrees/` is in `.gitignore` before creating.
4. Never hardcode worktree paths in remove operations — always read from `git worktree list`.
5. Default to subfolder placement unless the user explicitly chooses parent folder.
6. Default the worktree folder name to the last segment of the branch name.

## Triage (detect action)

If the user provided an argument (create, list, or remove), use that action.
If no argument was provided, ask the user which action they want:
- **create** — Create a new worktree with a new branch
- **list** — List all current worktrees
- **remove** — Remove an existing worktree

Then read the appropriate reference:

## Routing map

- **Creating a worktree** → `references/creating.md`
- **Listing worktrees** → `references/listing.md`
- **Removing a worktree** → `references/removing.md`
- **Placement strategies & conventions** → `references/placement.md`
- **Common issues & troubleshooting** → `references/troubleshooting.md`

## Common errors → next best move

- **"working trees containing submodules cannot be moved or removed"** → use `--force` flag (see `references/removing.md`)
- **Stale worktree references after manual deletion** → run `git worktree prune` (see `references/removing.md`)
- **Branch already checked out in another worktree** → list worktrees to find which one, remove or use a different branch
- **`.worktrees/` showing up in git status** → add to `.gitignore` (see `references/placement.md`)

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [jamesyorke](https://github.com/jamesyorke)
- **Source:** [jamesyorke/worktree-agent-skill](https://github.com/jamesyorke/worktree-agent-skill)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-jamesyorke-worktree-agent-skill-worktree-manager
- Seller: https://agentstack.voostack.com/s/jamesyorke
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
