Agent skill

Git Worktrees

by lexler in lexler/skill-factory

Creates git worktrees for parallel development. An agent skill from lexler/skill-factory.

Apache-2.0Auto-check passedAgent Workflows

Install Git Worktrees

skills CLI
$ npx skills add lexler/skill-factory --skill git-worktrees -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install lexler/skill-factory git-worktrees --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/lexler/skill-factory.git skills-src && mkdir -p .claude/skills && cp -r skills-src/output_skills/developer-tools/git-worktrees .claude/skills/git-worktrees && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
git-worktrees
GitHub stars
239
Token cost
~311 tokens
SKILL.md length
74 words
Files
1
Skills in repo
25
Repo updated
First seen
Licence
Apache-2.0

At a glance

Creates git worktrees for parallel development. An agent skill from lexler/skill-factory.

  • Works in 3 steps: Get project name from current directory → Create worktrees directory if needed:… → Create worktree with new branch: git…
  • Creating a git worktree
  • SKILL.md covers Directory Convention, Branch Naming, Workflow and Creating Multiple Worktrees, plus 1 more section
  • Calls git

What it does

Git Worktrees is an agent skill from lexler/skill-factory. Creates git worktrees for parallel development. Use when creating a git worktree, setting up multiple working directories, or working on features in parallel.

Its SKILL.md is about 310 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Agent Workflows, covering Git worktrees. It works with Git. The licence is Apache-2.0.

When your agent uses it

  • Creating a git worktree
  • Setting up multiple working directories
  • Working on features in parallel

Example prompts

  • “Use the git-worktrees skill to create git worktrees for parallel development. An agent skill from lexler/skill-factory”
  • “/git-worktrees”

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Get project name from current directory
  2. Create worktrees directory if needed: ../_worktrees/
  3. Create worktree with new branch: git worktree add -b

What it can do on your machine

Read from SKILL.md and the folder at commit 8017333. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Git Worktrees loads about 311 tokens when it runs. Until then it costs about 43 tokens; SKILL.md has 74 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~43
When it runs · the whole SKILL.md, loaded when a task matches
~311

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from lexler/skill-factory at commit 8017333, republished under its Apache-2.0 licence (© lexler). 74 words, ~311 tokens.

Download SKILL.mdSave it as .claude/skills/git-worktrees/SKILL.md (or your agent's skills folder).
name
git-worktrees
description
Creates git worktrees for parallel development. Use when creating a git worktree, setting up multiple working directories, or working on features in parallel.

Git Worktrees

Directory Convention

Worktrees live in a sibling directory named <project>_worktrees:

parent/
├── myproject/              # main repo
└── myproject_worktrees/    # worktrees directory
    ├── feature_1/
    └── feature_2/

Branch Naming

Use <feature>_<N> pattern when creating multiple worktrees:

  • auth-refactor_1, auth-refactor_2
  • api-migration_1, api-migration_2

Workflow

  1. Get project name from current directory
  2. Create worktrees directory if needed: ../<project>_worktrees/
  3. Create worktree with new branch: git worktree add <path> -b <branch>

Creating Multiple Worktrees

When asked for N worktrees for a feature:

bash
PROJECT=$(basename "$PWD")
WORKTREES_DIR="../${PROJECT}_worktrees"
mkdir -p "$WORKTREES_DIR"

for i in $(seq 1 N); do
    git worktree add "${WORKTREES_DIR}/<feature>_${i}" -b "<feature>_${i}"
done

Cleanup

Remove worktree and branch:

bash
git worktree remove <path>
git branch -d <branch>

List all worktrees: git worktree list

© lexler, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in output_skills/developer-tools/git-worktrees of lexler/skill-factory.

Open the folder on GitHubat commit 8017333

Compare with similar skills

Git Worktrees next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Git Worktrees compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Git Worktrees this skilllexler/skill-factory239—~311Automated safety check: PassApache-2.0
Using Git Worktreesfarm-fe/farm5.6k13 repos~2kAutomated safety check: PassMIT
Agtx Task Sweepfynnfluegge/agtx1.7k—~1.7kAutomated safety check: PassApache-2.0
PRP Workstream OrchestratorWirasm/prp2.3k—~3.5kAutomated safety check: PassMIT
Squad Agent Collaboration Patternsmicrosoft/waza1.4k4 repos~500Automated safety check: PassMIT
Vspawnvlinx-io/VelaTerm259—~2.5kAutomated safety check: PassMIT

Similar skills

  • A skill your agent uses when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git…

    5.6k GitHub starsUsed in 13 repos~2k tokens
    Agent WorkflowsAuto-check passed
  • Agtx Task Sweep

    fynnfluegge/agtx

    Breaks a conversation's results into feature-level tasks and pushes them to the agtx kanban board, where each task gets its own worktree and agent session.

    1.7k GitHub stars~1.7k tokensUpdated 5 days ago
    Agent WorkflowsAuto-check passed
  • Coordinates several PRP workstreams in isolated Git worktrees from one session, verifying proof, holding merge gates and sequencing the merges.

    2.3k GitHub stars~3.5k tokensUpdated 5 days ago
    Agent WorkflowsAuto-check passed
  • Official

    Shared collaboration rules for a team of squad agents covering worktree awareness, writing decisions to an inbox, cross-agent requests and reviewer lockout.

    1.4k GitHub starsUsed in 4 repos~500 tokens
    Agent WorkflowsAuto-check passed
  • Vspawn

    vlinx-io/VelaTerm

    Explicitly spawn a standalone child session under the current vlx-term session, passing the task in as its first message (mirrors spawntask).

    259 GitHub stars~2.5k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Guides decisions for agents working in an aweb team: when to check shared state, claim tasks, take locks, read team roles and instructions, and open separate worktrees.

    115 GitHub stars~4k tokensUpdated today
    Agent WorkflowsAuto-check passed

More from lexler/skill-factory

All 25 skills in this repo
  • C4 Architecture Diagrams

    lexler/skill-factory

    Creates C4 model diagrams at every zoom level, from system landscape to code, in ASCII, Mermaid or Structurizr, for designing or documenting software architecture.

    239 GitHub stars~2.3k tokensUpdated 1 mo ago
    Auto-check passed
  • Launching Agent Teams

    lexler/skill-factory

    Plans and launches Claude Code agent teams with distinct roles, right-sized tasks and detailed spawn prompts, and says when subagents or worktrees fit better.

    239 GitHub stars~1.3k tokensUpdated 1 mo ago
    Auto-check passed
  • Claude Code Statusline Writer

    lexler/skill-factory

    Guides writing and debugging Claude Code status line scripts that read session JSON from stdin and print one line of text.

    239 GitHub stars~872 tokensUpdated 1 mo ago
    Auto-check passed
  • Catalog of obstacles, anti-patterns and patterns for working with AI coding agents, covering context management and reliability, from a published patterns collection.

    239 GitHub stars~1.5k tokensUpdated 1 mo ago
    Auto-check passed
  • Approval Testing Toolkit

    lexler/skill-factory

    Writes snapshot-style approval tests in Python, JavaScript, TypeScript or Java, comparing output against an approved file instead of writing individual assertions.

    239 GitHub stars~1.2k tokensUpdated 1 mo ago
    Auto-check passed
  • Hotspots

    lexler/skill-factory

    Find where a codebase actually costs time by mining its git history (Tornhill hotspot analysis).

    239 GitHub stars~1.2k tokensUpdated 1 mo ago
    Auto-check passed

Works with

Questions about Git Worktrees

What does Git Worktrees do?

Creates git worktrees for parallel development. An agent skill from lexler/skill-factory. Git Worktrees is an agent skill from lexler/skill-factory. Creates git worktrees for parallel development.

When should I use Git Worktrees?

Git Worktrees fits situations like: creating a git worktree; setting up multiple working directories; working on features in parallel.

How do I install Git Worktrees in Claude Code?

Run `npx skills add lexler/skill-factory --skill git-worktrees -a claude-code`. Or copy the skill folder (output_skills/developer-tools/git-worktrees in lexler/skill-factory) into .claude/skills/git-worktrees in your project. Claude Code loads it when a task matches its description.

How do I install Git Worktrees in Codex?

Run `npx skills add lexler/skill-factory --skill git-worktrees -a codex`. Or copy the skill folder (output_skills/developer-tools/git-worktrees in lexler/skill-factory) into .agents/skills/git-worktrees in your project. Codex loads it when a task matches its description.

Can I use Git Worktrees in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add lexler/skill-factory --skill git-worktrees -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/git-worktrees, .gemini/skills/git-worktrees, .github/skills/git-worktrees and .opencode/skills/git-worktrees in your project.

What does Git Worktrees need to run?

Going by SKILL.md and its folder, Git Worktrees needs the command-line tools its instructions call (git).

Does Git Worktrees access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Git Worktrees safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Git Worktrees use?

Git Worktrees is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Git Worktrees use?

About 311 tokens (SKILL.md is roughly 1.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Git Worktrees?

Skills that share tags, products or a category with Git Worktrees: Using Git Worktrees (farm-fe/farm, 5.6k stars), Agtx Task Sweep (fynnfluegge/agtx, 1.7k stars), PRP Workstream Orchestrator (Wirasm/prp, 2.3k stars) and Squad Agent Collaboration Patterns (microsoft/waza, 1.4k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Git Worktrees?

lexler (a GitHub user) maintains it in lexler/skill-factory, which has 239 GitHub stars. The repository holds 25 skills in this directory. The repository was last updated on August 26, 2026.

Source: lexler/skill-factory on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.