Skip to content
Skill

Worktrees

Sets up isolated git worktrees so parallel agent tasks don't collide

Worktrees is an open-source agent skill for developer tools. It is available on Claude Code.

Scripts
None
Platforms
Claude Code
GitHub stars
6
Last commit
License
Apache-2.0
Listing updated

Similar skills

About Worktrees

This skill gives the agent a set of conventions and git commands for running several tasks side by side in separate git worktrees. Worktrees are placed under a worktrees/ folder at the project root, which should be gitignored, and branches follow a task-numbered naming pattern so each branch can be traced back to its plan.

The skill covers creating a worktree on a new or existing branch, checking whether the current directory is a worktree, listing and pruning entries, and removing them. It also sets cleanup rules: worktrees for merged tasks are offered for removal, while stalled or failed ones are kept until the user decides, and uncommitted work is never removed automatically.

For projects using compose-based runtimes, it describes how each worktree gets its own compose project, database name and port offset, and how to stop services and drop volumes before removal. It also lists common troubleshooting steps and anti-patterns to avoid. It expects git and, for the runtime section, the FFFlow justfile setup.

When your agent uses it

Isolated worktree management for parallel work — naming convention, creation, cleanup, troubleshooting.

From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.

What it can access

From a static check of its 1 file (5 KB) on GitHub on 4 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.

Check another skill before you install it.

Install

This skill ships in the fff plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

/plugin marketplace add zerotechdebt/ffflow
/plugin install fff@ffflow

Or copy only this skill to ~/.claude/skills/worktrees:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/zerotechdebt/ffflow.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/worktrees &&
cp -R "$tmp/plugin/skills/worktrees" ~/.claude/skills/worktrees &&
rm -rf "$tmp"

For one project only, put the folder in .claude/skills/worktrees inside it instead.

Claude Code docs on skills

Copy the skill folder to ~/.agents/skills/worktrees to use it in every repository:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/zerotechdebt/ffflow.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/worktrees &&
cp -R "$tmp/plugin/skills/worktrees" ~/.agents/skills/worktrees &&
rm -rf "$tmp"

For one repository only, put the folder in .agents/skills/worktrees inside it instead.

Codex docs on skills

Copy the skill folder to ~/.cursor/skills/worktrees to use it in every project:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/zerotechdebt/ffflow.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/worktrees &&
cp -R "$tmp/plugin/skills/worktrees" ~/.cursor/skills/worktrees &&
rm -rf "$tmp"

For one project only, put the folder in .cursor/skills/worktrees inside it instead.

Cursor docs on skills

Run in a terminal (add --scope workspace to install it for the current workspace only):

gemini skills install https://github.com/zerotechdebt/ffflow.git --path plugin/skills/worktrees

Or copy the folder to ~/.gemini/skills/worktrees yourself.

Gemini CLI docs on skills

For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/worktrees:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/zerotechdebt/ffflow.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/worktrees &&
cp -R "$tmp/plugin/skills/worktrees" ~/.copilot/skills/worktrees &&
rm -rf "$tmp"

For one project only, put the folder in .github/skills/worktrees inside it instead.

VS Code docs on skills

Get the folder:

git clone --depth 1 https://github.com/zerotechdebt/ffflow.git

Then copy ffflow/plugin/skills/worktrees into your agent's skills folder as worktrees. Agents that support SKILL.md read one folder per skill.

The SKILL.md format

What it does

Worktree placement convention
Defines where worktrees live in the project tree and why they stay out of the temp directory and the git folder.
Branch naming pattern
Gives a task-numbered branch naming scheme that ties each branch to its originating plan.
Create and remove commands
Lists the git worktree commands for adding, removing, listing and pruning worktrees.
Cleanup discipline
Specifies when worktrees should be removed after merge and when they should be retained for inspection.
Per-worktree runtime isolation
Explains how compose projects, ports and database names are derived per worktree when a compose runtime is configured.
Troubleshooting guide
Covers common worktree errors such as branches already checked out and port allocation conflicts.

Good for

  • Set up a separate worktree for a new task branch
  • Run several coding tasks in parallel without file conflicts
  • Clean up worktrees after their pull requests are merged
  • Find and prune worktrees whose directories were deleted
  • Start isolated database and app services for a worktree

Worktrees FAQ

Where does this skill put worktrees?

By default under a worktrees/ folder at the project root, which should be added to .gitignore.

Does it remove worktrees automatically?

No. It says not to auto-remove, and removal of worktrees with uncommitted changes requires user confirmation.

What naming pattern does Worktrees use for branches?

Branches follow task/<plan>/task-<N>-<short-title>, for example task/password-rules/task-2-signup-integration.

Does Worktrees need any scripts?

The skill itself ships no scripts; it relies on git commands, and the runtime section refers to justfile recipes in another skill.

How do I install Worktrees in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/worktrees to use it in all your projects, or to .claude/skills/worktrees in one project. Or install the fff plugin, which includes it: /plugin marketplace add zerotechdebt/ffflow, then /plugin install fff@ffflow.

Does Worktrees run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

Which AI agents can use Worktrees?

Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.

What are the best alternatives to Worktrees?

The closest alternatives to Worktrees are Git worktree, Worktrees, Wt, Harness read write base repo path in worktree stale tree and Git clean worktrees.

Where this comes from

  • Description: from the skill's own SKILL.md.

More from zerotechdebt/ffflow

  1. Onboards a project onto FFFlow: config, stack setup, then a phased roadmap

    • Open source
    • 6 GitHub stars
    • Developer tools
  2. Runs keep-honest audits on a project and reports drift, stale docs and tech debt

    • Open source
    • 6 GitHub stars
    • Developer tools
  3. Runs another interactive skill unattended, making routine choices from project context

    • Open source
    • 6 GitHub stars
    • Developer tools
  4. Lists and validates the adapter cartridges that FFFlow ports load in a project

    • Open source
    • 6 GitHub stars
    • Developer tools
  5. Extracts a behavioral spec from an unspecified codebase and plans characterization tests

    • Open source
    • 6 GitHub stars
    • Developer tools
  6. Adds GitHub Actions workflows that run FFFlow quality gates on pull requests

    • Open source
    • 6 GitHub stars
    • Developer tools