Agent skill

Git Worktrees

by Zfinix in Zfinix/aster

Isolating work in a linked worktree so another branch can be built, tested, or fixed without touching the current checkout.

Apache-2.0Auto-check passedDevelopment

Install Git Worktrees

skills CLI
$ npx skills add Zfinix/aster --skill git-worktrees -a claude-code

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

GitHub CLI
$ gh skill install Zfinix/aster 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/Zfinix/aster.git skills-src && mkdir -p .claude/skills && cp -r skills-src/crates/aster-skills/builtins/internal/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
112
Token cost
~752 tokens
SKILL.md length
449 words
Files
1
Skills in repo
19
Repo updated
First seen
Licence
Apache-2.0

At a glance

Isolating work in a linked worktree so another branch can be built, tested, or fixed without touching the current checkout.

  • Works in 10 steps: Reach for a worktree only when the… → List before creating. git worktree list… → Create with an explicit branch. New branch → …
  • The working tree is dirty
  • Calls git, make and cargo
  • Busy and the task needs a different branch checked out

What it does

Git Worktrees is an agent skill from Zfinix/aster. Isolating work in a linked worktree so another branch can be built, tested, or fixed without touching the current checkout. Use when the working tree is dirty or busy and the task needs a different branch checked out.

Its SKILL.md is about 750 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 Development, covering Git worktrees. It works with Git. The repository describes itself as: An open-source agent harness for software work. The licence is Apache-2.0.

When your agent uses it

  • The working tree is dirty
  • Busy and the task needs a different branch checked out

Example prompts

  • “/git-worktrees”

Workflow steps

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

  1. Reach for a worktree only when the current checkout must stay put. The
  2. List before creating. git worktree list first; pick a path and branch
  3. Create with an explicit branch. New branch
  4. Put the worktree where the sandbox can write and git will not sweep it.
  5. Know what is shared. Commits and branches are shared through the one
  6. Run checks inside the worktree. cd first, then the project's
  7. Remove with git, not with rm. git worktree remove when the
  8. The branch outlives the worktree. Removing the worktree keeps its
  9. Never mv a worktree directory. It breaks the gitdir link. Use
  10. Leave no worktrees behind. A worktree created for one task is removed

What it can do on your machine

Read from SKILL.md and the folder at commit 3fbb67c. 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
    • make
    • cargo

    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 752 tokens when it runs. Until then it costs about 58 tokens; SKILL.md has 449 words of instructions outside code blocks.

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

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 Zfinix/aster at commit 3fbb67c, republished under its Apache-2.0 licence (© Zfinix). 449 words, ~752 tokens.

Download SKILL.mdSave it as .claude/skills/git-worktrees/SKILL.md (or your agent's skills folder).
name
git-worktrees
description
Isolating work in a linked worktree so another branch can be built, tested, or fixed without touching the current checkout. Use when the working tree is dirty or busy and the task needs a different branch checked out.

Git worktrees

  1. Reach for a worktree only when the current checkout must stay put. The user is mid-edit, the tree is dirty, or a long build is running and the task needs a different branch. A clean idle tree does not need one: git stash or a plain git checkout is simpler.
  2. List before creating. git worktree list first; pick a path and branch that are not already taken.
  3. Create with an explicit branch. New branch: git worktree add <path> -b <branch>. Existing branch: git worktree add <path> <branch>. A branch checked out in one worktree cannot be checked out in another: fatal: '<branch>' is already used by worktree at '<path>'. Pick a new branch name instead of forcing it.
  4. Put the worktree where the sandbox can write and git will not sweep it. Inside the repo under a gitignored path (<repo>/target/wt/<name>) or in /tmp. A sibling directory outside the repo fails the filesystem write policy, and an untracked directory inside the repo pollutes git status and git add sweeps. Verify the path is actually ignored with git check-ignore -q <path>; if it is not, add it to .git/info/exclude rather than editing the user's .gitignore.
  5. Know what is shared. Commits and branches are shared through the one object store: a commit made in the worktree is immediately visible from the main checkout. HEAD, the index, and untracked files are per-worktree. Build artifacts (target/, node_modules/) are not shared either: the first build in a fresh worktree is a full cold build. Budget for it and say so if it will be slow.
  6. Run checks inside the worktree. cd <path> first, then the project's own verbs (make test, cargo test -p <crate>). Running them from the main repo tests the wrong tree.
  7. Remove with git, not with rm. git worktree remove <path> when the work is done. It refuses a dirty tree: contains modified or untracked files, use --force to delete it. Reset or clean the tree first, or use --force only when losing the changes is the agreed outcome. rm -rf by hand leaves a prunable entry; repair with git worktree prune -v.
  8. The branch outlives the worktree. Removing the worktree keeps its branch. Delete it too when the work was abandoned (git branch -D counts as destructive: say what is being deleted and why).
  9. Never mv a worktree directory. It breaks the gitdir link. Use git worktree move <path> <new-path>.
  10. Leave no worktrees behind. A worktree created for one task is removed in the same session once its check ran, unless the user asked to keep it. git worktree list at the end of the task proves the cleanup.

© Zfinix, 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 crates/aster-skills/builtins/internal/git-worktrees of Zfinix/aster.

Open the folder on GitHubat commit 3fbb67c

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 skillZfinix/aster112—~752Automated safety check: PassApache-2.0
Build Px4 macOSPX4/PX4-Autopilot13k—~1.1kAutomated safety check: PassBSD-3-Clause
WorktreeAgentsMesh/AgentsMesh2.4k—~553Automated safety check: NotesCustom licence
Git Worktree IsolationjnMetaCode/superpowers-zh8.3k1 repos~982Automated safety check: PassMIT
Cursor Composer Task DelegateChachamaru127/claude-code-harness3.2k—~4.4kAutomated safety check: NotesMIT
Git Worktree Setupk8zdev/k8z155—~930Automated safety check: PassNone

Similar skills

  • Build Px4 macOS

    PX4/PX4-Autopilot

    Build PX4 board firmware on macOS in the px4-dev Docker container, including git worktrees, and stage commit-labeled artifacts without flashing hardware.

    13k GitHub stars~1.1k tokensUpdated today
    DevelopmentAuto-check passed
  • Worktree

    AgentsMesh/AgentsMesh

    Creates or reuses an isolated AgentsMesh Git worktree from a verified base branch, preserves existing changes, and optionally starts the worktree-scoped development environment.

    2.4k GitHub stars~553 tokensUpdated 14 days ago
    DevelopmentAuto-check: notes
  • Git Worktree Isolation

    jnMetaCode/superpowers-zh

    Sets up an isolated workspace before feature work or plan execution, preferring native worktree tools and falling back to git worktree, with instructions in Chinese.

    8.3k GitHub starsUsed in 1 repo~982 tokens
    DevelopmentAuto-check passed
  • Cursor Composer Task Delegate

    Chachamaru127/claude-code-harness

    Hands one implementation task to Cursor Composer in an isolated git worktree, then reviews its diff and cherry-picks the result into the main branch.

    3.2k GitHub stars~4.4k tokensUpdated 3 days ago
    DevelopmentAuto-check: notes
  • Automate git worktree creation and copy private files (not tracked in git) to new workdirs.

    155 GitHub stars~930 tokensUpdated 3 mo ago
    DevelopmentAuto-check passed
  • New Feature

    michaelshimeles/skills

    Start a new task in an isolated Git worktree branched from origin/main so multiple agents can work on the same repo in parallel without conflicts.

    1.3k GitHub starsUsed in 1 repo~699 tokens
    DevelopmentAuto-check passed

More from Zfinix/aster

All 19 skills in this repo
  • Artifact Design

    Zfinix/aster

    Designing and building any user-facing surface: a web page, landing page, dashboard, report, HTML document, email, or a component inside an existing app.

    112 GitHub stars~2.8k tokensUpdated 2 days ago
    Auto-check passed
  • Drive aster chat programmatically and manage sessions and memory: one-shot --print/--json answers, --messages-json for caller-owned history, --continue and --session persistence, --allow-edits…

    112 GitHub stars~591 tokensUpdated 2 days ago
    Auto-check passed
  • Aster CLI

    Zfinix/aster

    Guidance for using the aster CLI to work in a codebase with an AI agent: chat and edit code, run AI code reviews, apply fixes, and manage sessions, memory, and skills.

    112 GitHub stars~1.2k tokensUpdated 2 days ago
    Auto-check passed
  • Aster Config

    Zfinix/aster

    Reference for aster.yaml, covering review models, analyzers, focus areas, include/exclude globs, minconfidence, and the permissions block that gates edits.

    112 GitHub stars~1.2k tokensUpdated 2 days ago
    Auto-check passed
  • Aster Fix Workflow

    Zfinix/aster

    Pipe aster review findings into aster fix to generate and apply patches safely, using review --json, fix --findings-json, dry-run inspection, --apply, and permission gating.

    112 GitHub stars~534 tokensUpdated 2 days ago
    Auto-check passed
  • Aster Planning

    Zfinix/aster

    Create and execute structured plans for multi-step tasks. An agent skill from Zfinix/aster.

    112 GitHub stars~1k tokensUpdated 2 days ago
    Auto-check passed

Works with

Questions about Git Worktrees

What does Git Worktrees do?

Isolating work in a linked worktree so another branch can be built, tested, or fixed without touching the current checkout. Git Worktrees is an agent skill from Zfinix/aster. Isolating work in a linked worktree so another branch can be built, tested, or fixed without touching the current checkout.

When should I use Git Worktrees?

Git Worktrees fits situations like: the working tree is dirty; busy and the task needs a different branch checked out.

How do I install Git Worktrees in Claude Code?

Run `npx skills add Zfinix/aster --skill git-worktrees -a claude-code`. Or copy the skill folder (crates/aster-skills/builtins/internal/git-worktrees in Zfinix/aster) 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 Zfinix/aster --skill git-worktrees -a codex`. Or copy the skill folder (crates/aster-skills/builtins/internal/git-worktrees in Zfinix/aster) 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 Zfinix/aster --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, make and cargo).

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 752 tokens (SKILL.md is roughly 3k 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: Build Px4 macOS (PX4/PX4-Autopilot, 13k stars), Worktree (AgentsMesh/AgentsMesh, 2.4k stars), Git Worktree Isolation (jnMetaCode/superpowers-zh, 8.3k stars) and Cursor Composer Task Delegate (Chachamaru127/claude-code-harness, 3.2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Git Worktrees?

Zfinix (a GitHub user) maintains it in Zfinix/aster, which has 112 GitHub stars. The repository holds 19 skills in this directory. The repository was last updated on October 6, 2026.

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