Agent skill

Worktree

by shibing624 in shibing624/agentica

Isolate parallel work in a git worktree of the current repository (worktree tool: status / new / merge / remove).

Apache-2.0Auto-check passedDevelopment

Install Worktree

skills CLI
$ npx skills add shibing624/agentica --skill worktree -a claude-code

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

GitHub CLI
$ gh skill install shibing624/agentica worktree --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/shibing624/agentica.git skills-src && mkdir -p .claude/skills && cp -r skills-src/agentica/skills/bundled/worktree .claude/skills/worktree && 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
worktree
GitHub stars
352
Token cost
~614 tokens
SKILL.md length
314 words
Files
1
Skills in repo
4
Repo updated
First seen
Licence
Apache-2.0

At a glance

Isolate parallel work in a git worktree of the current repository (worktree tool: status / new / merge / remove).

  • Another live session is dirty in the same directory (listagents)
  • SKILL.md covers When and How
  • Calls git
  • Two agents would fight over index.lock

What it does

Worktree is an agent skill from shibing624/agentica. Isolate parallel work in a git worktree of the current repository (worktree tool: status / new / merge / remove). Use when another live session is dirty in the same directory (listagents), when two agents would fight over index.lock, or when starting a parallel task checkout.

Its SKILL.md is about 610 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: One person, a team of agents. Multi-session CLI that collaborates across terminals; /goal keeps long tasks running; WeChat/WeCom/Feishu gateway lets you call them back when you… The licence is Apache-2.0.

When your agent uses it

  • Another live session is dirty in the same directory (listagents)
  • Two agents would fight over index.lock
  • Starting a parallel task checkout

Example prompts

  • “/worktree”

What it can do on your machine

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

Worktree loads about 614 tokens when it runs. Until then it costs about 72 tokens; SKILL.md has 314 words of instructions outside code blocks.

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

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 shibing624/agentica at commit e84fc48, republished under its Apache-2.0 licence (© shibing624). 314 words, ~614 tokens.

Download SKILL.mdSave it as .claude/skills/worktree/SKILL.md (or your agent's skills folder).
name
worktree
description
Isolate parallel work in a git worktree of the current repository (worktree tool: status / new / merge / remove). Use when another live session is dirty in the same directory (list_agents), when two agents would fight over index.lock, or when starting a parallel task checkout.
metadata.version
2.1

Isolate work in a worktree

Several sessions in one checkout overwrite each other and contend for git's index. A worktree is one directory + one branch per task, sharing the repository.

This session does not move. worktree(action="new") returns a path. Pass that path as work_dir on read_file / write_file / apply_patch / execute. On glob / grep, pass it as path. Omit those arguments and the call stays in this session's directory.

Do not cd and expect later calls to follow — each call is independent. Do not execute git worktree add: that only makes a directory, and later calls still use this session unless you pass work_dir / path. Use worktree(action="new").

When

  • list_agents shows another session in this directory (dirty files, same branch) and you are about to edit.
  • A change should not land on the shared working tree.

Not this: a read-only task subagent (it does not write). A second CLI that should start already inside a tree is agentica --worktree <task>.

How

Name the task, not yourself. Reused while the checkout is healthy; gone after merge. A registration that is no longer a checkout is refused — remove it first, or pick another name. The tool does not delete leftover files to make room.

  • worktree(action="new", name="<task>") — create or reuse; returns the path
  • worktree(action="status") — every worktree of this repo
  • worktree(action="merge", name="<task>") — land on local main (conflicts stay in that worktree, then fast-forward on main), delete the checkout
  • worktree(action="remove", name="<task>") — drop a wt/* checkout git will allow (dirty is refused; an unmerged branch is left in place)

new(name="main") is refused: main is the repository root, not a task.

For a chunk of work big enough for its own process, delegate(task=..., work_dir=<path>) already takes the same path.

If a directory goes missing, status labels it (directory gone) or (not a checkout). Say so; do not rebuild it by destroying what sits there. remove the name, then new if you still want it.

© shibing624, 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 agentica/skills/bundled/worktree of shibing624/agentica.

Open the folder on GitHubat commit e84fc48

Compare with similar skills

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

Worktree compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Worktree this skillshibing624/agentica352—~614Automated 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 15 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 shibing624/agentica

  • Multi Agent

    shibing624/agentica

    Run work across more than one agent — choose between the task subagent, the delegate tool, and a second agentica CLI in tmux driven by peer messages (listagents / sendmessage).

    352 GitHub stars~1.9k tokensUpdated 15 days ago
    Auto-check passed
  • Agentica

    shibing624/agentica

    How to answer questions about the agentica product you are running inside — CLI flags, config.yaml profiles, API keys, models, sessions, resume, workspace, AGENTS.md standing rules, skills, logs…

    352 GitHub stars~1.8k tokensUpdated 15 days ago
    Auto-check: notes
  • Cron

    shibing624/agentica

    Schedule, list, pause, resume, edit, or run the user's agentica cron jobs with the cronjob tool.

    352 GitHub stars~317 tokensUpdated 15 days ago
    Auto-check passed

Works with

Questions about Worktree

What does Worktree do?

Isolate parallel work in a git worktree of the current repository (worktree tool: status / new / merge / remove). Worktree is an agent skill from shibing624/agentica. Isolate parallel work in a git worktree of the current repository (worktree tool: status / new / merge / remove).

When should I use Worktree?

Worktree fits situations like: another live session is dirty in the same directory (listagents); two agents would fight over index.lock; starting a parallel task checkout.

How do I install Worktree in Claude Code?

Run `npx skills add shibing624/agentica --skill worktree -a claude-code`. Or copy the skill folder (agentica/skills/bundled/worktree in shibing624/agentica) into .claude/skills/worktree in your project. Claude Code loads it when a task matches its description.

How do I install Worktree in Codex?

Run `npx skills add shibing624/agentica --skill worktree -a codex`. Or copy the skill folder (agentica/skills/bundled/worktree in shibing624/agentica) into .agents/skills/worktree in your project. Codex loads it when a task matches its description.

Can I use Worktree 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 shibing624/agentica --skill worktree -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/worktree, .gemini/skills/worktree, .github/skills/worktree and .opencode/skills/worktree in your project.

What does Worktree need to run?

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

Does Worktree 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 Worktree 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 Worktree use?

Worktree 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 Worktree use?

About 614 tokens (SKILL.md is roughly 2.5k 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 Worktree?

Skills that share tags, products or a category with Worktree: 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 Worktree?

shibing624 (a GitHub user) maintains it in shibing624/agentica, which has 352 GitHub stars. The repository holds 4 skills in this directory. The repository was last updated on September 23, 2026.

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