Agent skill

Using Git Worktrees

by aaddrick in aaddrick/claude-pipeline

A skill your agent uses when starting feature work that needs isolation from current workspace or before executing implementation plans - creates isolated git worktrees in .worktrees/

MITAuto-check passedAgent Workflows

Install Using Git Worktrees

skills CLI
$ npx skills add aaddrick/claude-pipeline --skill using-git-worktrees -a claude-code

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

GitHub CLI
$ gh skill install aaddrick/claude-pipeline using-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/aaddrick/claude-pipeline.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/using-git-worktrees .claude/skills/using-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
using-git-worktrees
GitHub stars
130
Token cost
~1.3k tokens
SKILL.md length
416 words
Files
1
Skills in repo
12
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when starting feature work that needs isolation from current workspace or before executing implementation plans - creates isolated git worktrees in .worktrees/

  • Works in 4 steps: Create Worktree → Run Project Setup → Verify Baseline → …
  • Starting feature work that needs isolation from current workspace
  • SKILL.md covers Overview, Safety Verification, Creation Steps and Quick Reference, plus 4 more sections
  • Calls npm, composer and git

What it does

Using Git Worktrees is an agent skill from aaddrick/claude-pipeline. Use when starting feature work that needs isolation from current workspace or before executing implementation plans - creates isolated git worktrees in .worktrees/

Its SKILL.md is about 1.3k 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 Laravel, npm, Git and Vite. The repository describes itself as: Portable Claude Code multi-agent pipeline - skills, agents, hooks, orchestration scripts, and quality gates. The licence is MIT.

When your agent uses it

  • Starting feature work that needs isolation from current workspace
  • Before executing implementation plans - creates isolated git worktrees in .worktrees/

Example prompts

  • “/using-git-worktrees”

Requirements

  • Python 3
  • Node.js

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Create Worktree
  2. Run Project Setup
  3. Verify Baseline
  4. Report Location

What it can do on your machine

Read from SKILL.md and the folder at commit 402eac7. 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:

    • npm
    • composer
    • git
    • php

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

  • Network

    No URLs in SKILL.md. Its commands use npm and 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

Using Git Worktrees loads about 1.3k tokens when it runs. Until then it costs about 46 tokens; SKILL.md has 416 words of instructions outside code blocks.

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

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 aaddrick/claude-pipeline at commit 402eac7, republished under its MIT licence (© aaddrick). 416 words, ~1,305 tokens.

Download SKILL.mdSave it as .claude/skills/using-git-worktrees/SKILL.md (or your agent's skills folder).
name
using-git-worktrees
description
Use when starting feature work that needs isolation from current workspace or before executing implementation plans - creates isolated git worktrees in .worktrees/

Using Git Worktrees

Overview

Git worktrees create isolated workspaces sharing the same repository, allowing work on multiple branches simultaneously without switching.

Location: Always use .worktrees/ (per CLAUDE.md)

Announce at start: "I'm using the using-git-worktrees skill to set up an isolated workspace."

Safety Verification

Verify .worktrees/ is ignored before creating worktree:

bash
git check-ignore -q .worktrees 2>/dev/null

If NOT ignored: Add to .gitignore and commit before proceeding.

Why critical: Prevents accidentally committing worktree contents to repository.

Creation Steps

1. Create Worktree
bash
git worktree add .worktrees/$BRANCH_NAME -b $BRANCH_NAME $BASE_BRANCH
cd .worktrees/$BRANCH_NAME
2. Run Project Setup

Laravel:

Fresh worktrees don't have vendor/ or node_modules/. Install dependencies first:

bash
# 1. Create bootstrap/cache (required for composer)
mkdir -p bootstrap/cache

# 2. Install PHP dependencies
composer install --no-interaction

# 3. Run Laravel setup (migrations, seeds, caches)
php artisan migrate --seed

# 4. Build frontend assets (Vite manifest required for tests)
npm install && npm run build

Why this order matters:

  • bootstrap/cache must exist before composer runs post-install scripts
  • vendor/ must exist before artisan commands work
  • Vite manifest must exist or tests using views will fail

Other projects: Auto-detect from project files:

bash
if [ -f package.json ]; then npm install; fi
if [ -f Cargo.toml ]; then cargo build; fi
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f pyproject.toml ]; then poetry install; fi
if [ -f go.mod ]; then go mod download; fi
3. Verify Baseline

Run tests to ensure worktree starts clean:

bash
# Laravel
php artisan test

# Other
npm test / cargo test / pytest / go test ./...

If tests fail: Verify setup completed correctly (vendor/, node_modules/, Vite manifest all exist). Compare with main worktree to identify if failures are pre-existing.

If tests pass: Report ready.

4. Report Location
Worktree ready at <full-path>
Branch: <branch-name>
Tests: <N> passed (<M> pre-existing failures if any)
Ready to implement <feature-name>

Quick Reference

SituationAction
Creating worktreegit worktree add .worktrees/$BRANCH -b $BRANCH $BASE
.worktrees/ not ignoredAdd to .gitignore + commit first
Laravel projectmkdir -p bootstrap/cache → composer install → php artisan migrate --seed → npm install && npm run build
Other projectsAuto-detect from package.json, Cargo.toml, etc.
Tests fail during baselineVerify setup complete (vendor/, node_modules/, Vite manifest), compare with main

Common Mistakes

Skipping ignore verification
  • Problem: Worktree contents get tracked, pollute git status
  • Fix: Always use git check-ignore before creating worktree
Show full SKILL.md (172 more words)Show less
Running artisan commands before composer install
  • Problem: Fresh worktrees have no vendor/ directory - artisan commands fail
  • Fix: Run composer install first, then artisan commands
Missing bootstrap/cache directory
  • Problem: Composer post-install scripts fail with "directory must be present and writable"
  • Fix: Create mkdir -p bootstrap/cache before running composer install
Skipping npm build
  • Problem: Tests that render views fail with "Vite manifest not found"
  • Fix: Run npm install && npm run build after Laravel setup
Hardcoding setup commands
  • Problem: Breaks on projects using different tools
  • Fix: Use documented sequence for Laravel, auto-detect for others

Example Workflow

You: I'm using the using-git-worktrees skill to set up an isolated workspace.

[Verify ignored: git check-ignore .worktrees - confirmed]
[Create worktree: git worktree add .worktrees/issue-123 -b issue-123-feature aw-next]
[mkdir -p bootstrap/cache]
[composer install --no-interaction]
[php artisan migrate --seed]
[npm install && npm run build]
[php artisan test - all tests passed]

Worktree ready at /home/user/project/.worktrees/issue-123
Branch: issue-123-feature
Tests: 639 passed (0 failures)
Ready to implement feature

Red Flags

Never:

  • Create worktree without verifying .worktrees/ is ignored
  • Run artisan commands before composer install in fresh worktree
  • Skip npm run build - tests will fail on missing Vite manifest

Always:

  • Use .worktrees/ directory
  • Verify directory is ignored
  • Create bootstrap/cache before composer install
  • Follow setup order: composer → artisan migrate → npm build

Integration

Called by:

  • brainstorming (Phase 4) - when design is approved
  • implement-issue - for isolated feature work

Pairs with:

  • finishing-a-development-branch - cleanup after work complete
  • subagent-driven-development - work happens in this worktree

© aaddrick, MIT. 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 .claude/skills/using-git-worktrees of aaddrick/claude-pipeline.

Open the folder on GitHubat commit 402eac7

Compare with similar skills

Using 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.

Using Git Worktrees compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Using Git Worktrees this skillaaddrick/claude-pipeline130—~1.3kAutomated safety check: PassMIT
Devcontainer Devstacklok/toolhive-studio170—~3.8kAutomated safety check: NotesApache-2.0
Squad Git Branching Workflowmicrosoft/waza1.4k4 repos~1.5kAutomated safety check: PassMIT
Cabloy Worktree Environmentcabloy/cabloy982—~2.9kAutomated safety check: NotesMIT
Version Bump and ReleaseescapeWu/perplexity-ai169—~528Automated safety check: PassMIT
Move To Worktreefoyzulkarim/claude-lens250—~663Automated safety check: NotesMIT

Similar skills

  • Devcontainer Dev

    stacklok/toolhive-studio

    Spin up and interact with ToolHive Studio's containerized dev environment (Xvfb + noVNC + DinD).

    170 GitHub stars~3.8k tokensUpdated yesterday
    Agent WorkflowsAuto-check: notes
  • Official

    Dev-first branching model for the Squad project: feature work branches from dev, issue branches follow a naming rule and parallel issues use git worktrees.

    1.4k GitHub starsUsed in 4 repos~1.5k tokens
    DevelopmentAuto-check passed
  • This skill must be used only when the user explicitly invokes /cabloy-worktree-environment or explicitly asks to perform the named Cabloy worktree-environment setup.

    982 GitHub stars~2.9k tokensUpdated yesterday
    DevelopmentAuto-check: notes
  • Version Bump and Release

    escapeWu/perplexity-ai

    Bumps a project version, updates both changelogs, builds the frontend, then commits, tags and pushes the release.

    169 GitHub stars~528 tokensUpdated 10 days ago
    DevelopmentAuto-check passed
  • Move To Worktree

    foyzulkarim/claude-lens

    After /start-task: park the current clean, pushed feature branch in its own issue-numbered nested worktree (.worktrees/<issue) and return the primary checkout to current main, so the next parallel…

    250 GitHub stars~663 tokensUpdated 2 mo ago
    DevelopmentAuto-check: notes
  • Git PR Workflow

    andymai/brepjs

    This skill should be used when committing, pushing, branching, or merging in the brepjs repository — when a task involves "pre-commit hook failed" (which tier ran, how to bypass), "commit rejected…

    114 GitHub stars~2.9k tokensUpdated yesterday
    DevelopmentAuto-check passed

More from aaddrick/claude-pipeline

All 12 skills in this repo
  • Writing Agents

    aaddrick/claude-pipeline

    A skill your agent uses when creating new agents, editing existing agents, or defining specialized subagent roles for the Task tool

    130 GitHub starsUsed in 1 repo~3.3k tokens
    Auto-check passed
  • Adapting Claude Pipeline

    aaddrick/claude-pipeline

    A skill your agent uses when adapting the generic .claude pipeline folder to a specific codebase - adjusting skills, agents, hooks, scripts, prompts, and settings for the target project's tech stack…

    130 GitHub stars~2.8k tokensUpdated 7 mo ago
    Auto-check passed
  • A skill your agent uses when asked to create user stories from a codebase, document existing features as stories, or reverse-engineer requirements from code

    130 GitHub stars~2.2k tokensUpdated 7 mo ago
    Auto-check passed
  • Review UI

    aaddrick/claude-pipeline

    Comprehensive UI/CSS review using parallel agents. An agent skill from aaddrick/claude-pipeline.

    130 GitHub stars~2.5k tokensUpdated 7 mo ago
    Auto-check passed
  • Implement Issue

    aaddrick/claude-pipeline

    A skill your agent uses when given a GitHub issue number and base branch to implement end-to-end

    130 GitHub starsUsed in 1 repo~889 tokens
    Auto-check passed
  • Write Docblocks

    aaddrick/claude-pipeline

    A skill your agent uses when documentation coverage is low, after composer docs:coverage shows gaps, or when asked to batch-write PHPDoc blocks across multiple files

    130 GitHub stars~956 tokensUpdated 7 mo ago
    Auto-check passed

Questions about Using Git Worktrees

What does Using Git Worktrees do?

A skill your agent uses when starting feature work that needs isolation from current workspace or before executing implementation plans - creates isolated git worktrees in .worktrees/. Using Git Worktrees is an agent skill from aaddrick/claude-pipeline.

When should I use Using Git Worktrees?

Using Git Worktrees fits situations like: starting feature work that needs isolation from current workspace; before executing implementation plans - creates isolated git worktrees in .worktrees/.

How do I install Using Git Worktrees in Claude Code?

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

How do I install Using Git Worktrees in Codex?

Run `npx skills add aaddrick/claude-pipeline --skill using-git-worktrees -a codex`. Or copy the skill folder (.claude/skills/using-git-worktrees in aaddrick/claude-pipeline) into .agents/skills/using-git-worktrees in your project. Codex loads it when a task matches its description.

Can I use Using 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 aaddrick/claude-pipeline --skill using-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/using-git-worktrees, .gemini/skills/using-git-worktrees, .github/skills/using-git-worktrees and .opencode/skills/using-git-worktrees in your project.

What does Using Git Worktrees need to run?

Going by SKILL.md and its folder, Using Git Worktrees needs the command-line tools its instructions call (npm, composer, git and php). Our summary lists: Python 3; Node.js.

Does Using Git Worktrees access the network?

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

Is Using 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 Using Git Worktrees use?

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

How many tokens does Using Git Worktrees use?

About 1.3k tokens (SKILL.md is roughly 5.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 Using Git Worktrees?

Skills that share tags, products or a category with Using Git Worktrees: Devcontainer Dev (stacklok/toolhive-studio, 170 stars), Squad Git Branching Workflow (microsoft/waza, 1.4k stars), Cabloy Worktree Environment (cabloy/cabloy, 982 stars) and Version Bump and Release (escapeWu/perplexity-ai, 169 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Using Git Worktrees?

aaddrick (a GitHub user) maintains it in aaddrick/claude-pipeline, which has 130 GitHub stars. The repository holds 12 skills in this directory. The repository was last updated on February 25, 2026.

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