# Worktree Ops

> Operational guidance for Cursor's /worktree command. Activates when deciding whether to isolate a task in a dedicated worktree for parallel or risky work.

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

---


# /worktree — Task Isolation via Worktrees

Guidance for when and how to use Cursor's worktree isolation feature.

## When to use

- Risky refactors that may break the working tree
- Parallel implementations of independent features
- Experimental spikes you want to discard cleanly
- Long-running tasks that shouldn't block the main branch

## How it works

1. `/worktree` creates an isolated git worktree with its own branch
2. Work proceeds independently — no conflicts with main
3. When done, merge or cherry-pick back, then clean up the worktree

## Best practices

- Name worktrees descriptively: `feat/short-description` or `fix/issue-ref`
- Keep worktree lifespan short — merge or discard within a session
- Use `--worktree` flag with `cursor agent` for headless runs

