Agent skill

Worktree

by letehaha in letehaha/moneymatter

Manage git worktrees for parallel Claude Code sessions. An agent skill from letehaha/moneymatter.

AGPL-3.0Auto-check: notesDevelopment

Install Worktree

skills CLI
$ npx skills add letehaha/moneymatter --skill worktree -a claude-code

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

GitHub CLI
$ gh skill install letehaha/moneymatter 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/letehaha/moneymatter.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/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
160
Token cost
~907 tokens
SKILL.md length
333 words
Files
1
Skills in repo
10
Repo updated
First seen
Licence
AGPL-3.0

At a glance

Manage git worktrees for parallel Claude Code sessions. An agent skill from letehaha/moneymatter.

  • Works in 7 steps: Parse arguments → Determine paths → Fetch latest → …
  • User says worktree
  • SKILL.md covers Commands, Instructions, Safety Rules and Troubleshooting
  • Calls git, npm and claude

What it does

Worktree is an agent skill from letehaha/moneymatter. Manage git worktrees for parallel Claude Code sessions. Use when user says "worktree", "create worktree", "parallel session", "new tree", or wants to work on multiple branches simultaneously.

Its SKILL.md is about 910 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: A personal budget tracking application. Track your balances and transactions with bank connections or manual entry, categorize and analyze expenses and income, and many more. The licence is AGPL-3.0.

When your agent uses it

  • User says worktree
  • Create worktree
  • Parallel session
  • Wants to work on multiple branches simultaneously

Example prompts

  • “worktree”
  • “create worktree”
  • “parallel session”
  • “/worktree”

Requirements

  • Node.js
  • Pre-approved tools (allowed-tools): Bash, Glob, AskUserQuestion

Workflow steps

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

  1. Parse arguments
  2. Determine paths
  3. Fetch latest
  4. Create worktree
  5. Install dependencies
  6. Return to original directory
  7. CRITICAL - Output this format at the end

What it can do on your machine

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

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Bash
    • Glob
    • AskUserQuestion

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git
    • npm
    • claude

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

  • Network

    No URLs in SKILL.md. Its commands use git and npm, 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 907 tokens when it runs. Until then it costs about 50 tokens; SKILL.md has 333 words of instructions outside code blocks.

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

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: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Bash, Glob, AskUserQuestion

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 letehaha/moneymatter at commit de5319f, republished under its AGPL-3.0 licence (© letehaha). 333 words, ~907 tokens.

Download SKILL.mdSave it as .claude/skills/worktree/SKILL.md (or your agent's skills folder).
name
worktree
description
Manage git worktrees for parallel Claude Code sessions. Use when user says "worktree", "create worktree", "parallel session", "new tree", or wants to work on multiple branches simultaneously.
allowed-tools
Bash, Glob, AskUserQuestion

Git Worktree Manager

Manage git worktrees for running parallel Claude Code sessions.

Commands

/worktree create <branch-name> [from <base-branch>]

Creates a new git worktree for parallel development.

Examples:

  • /worktree create fix-bug - Creates worktree from origin/main
  • /worktree create fix-bug from main - Creates worktree from main branch
  • /worktree create feature-x from develop - Creates from develop
/worktree list

Lists all active worktrees.

/worktree remove [<worktree-name>]

Removes a worktree and its local branch.


Instructions

For create command:
  1. Parse arguments:

    • <branch-name>: Required, the new branch name
    • <base-branch>: Optional, defaults to origin/main
  2. Determine paths:

    bash
    REPO_BASENAME=$(basename "$PWD")
    WORKTREE_PATH="../${REPO_BASENAME}--${BRANCH_NAME}"
    ABSOLUTE_PATH=$(cd .. && pwd)/${REPO_BASENAME}--${BRANCH_NAME}
  3. Fetch latest:

    bash
    git fetch origin
  4. Create worktree:

    bash
    git worktree add -b <branch-name> <worktree-path> <base-branch>
  5. Install dependencies:

    bash
    cd <worktree-path> && npm install
  6. Return to original directory

  7. CRITICAL - Output this format at the end:

    Worktree created successfully!
    
      Branch: <branch-name>
      Base:   <base-branch>
      Path:   <absolute-path>
    
    To start a parallel Claude Code session, copy and run:
    ┌────────────────────────────────────────────────────────────┐
    │ cd <absolute-path> && claude                               │
    └────────────────────────────────────────────────────────────┘

For list command:

Run and display output:

bash
git worktree list

For remove command:
  1. If no worktree name provided, show git worktree list and ask user to specify

  2. Parse worktree name to extract branch:

    • Worktree format: <repo>--<branch>
    • Extract branch: everything after --
  3. Ask for confirmation before proceeding

  4. Remove worktree:

    bash
    git worktree remove <worktree-path> --force
  5. Delete local branch:

    bash
    git branch -D <branch-name>
  6. Confirm: "Removed worktree and local branch. Remote branch preserved for PR."


Show full SKILL.md (158 more words)Show less

Safety Rules

  • Always git fetch before creating to have latest refs
  • Never remove worktrees with uncommitted changes without explicit confirmation
  • Never remove the main worktree (one without -- in directory name)
  • Preserve remote branches when removing (only delete local branch)
  • If branch already exists, ask user if they want to use existing or create new name

Troubleshooting

Error: "fatal: '<branch>' is already checked out at '<path>'"

Cause: The branch is already in use by another worktree Solution: Use git worktree list to find the existing worktree, then either remove it or choose a different branch name.

Error: "fatal: a branch named '<branch>' already exists"

Cause: Local branch with that name already exists Solution: Ask user if they want to reuse the existing branch or pick a new name.

Worktree remove fails with "contains modified or untracked files"

Cause: There are uncommitted changes in the worktree Solution: Ask user for explicit confirmation before using --force. Warn about potential data loss.

© letehaha, AGPL-3.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 .claude/skills/worktree of letehaha/moneymatter.

Open the folder on GitHubat commit de5319f

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 skillletehaha/moneymatter160—~907Automated safety check: NotesAGPL-3.0
Finishing a Development Branchobra/superpowers296k5 repos~1.9kAutomated safety check: PassMIT
Finishing A Development Branchfarm-fe/farm5.6k34 repos~1.8kAutomated safety check: PassMIT
Git Worktree Cleanuplobehub/lobehub83k—~2.8kAutomated safety check: PassCustom licence
Pre-Release PR Triagejamiepine/voicebox57k—~3.1kAutomated safety check: PassMIT
Ccmanager Configkbwo/ccmanager1.3k—~1.5kAutomated safety check: PassMIT

Similar skills

  • Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.

    296k GitHub starsUsed in 5 repos~1.9k tokens
    DevelopmentAuto-check passed
  • A skill your agent uses when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for…

    5.6k GitHub starsUsed in 34 repos~1.8k tokens
    DevelopmentAuto-check passed
  • Git Worktree Cleanup

    lobehub/lobehub

    Audits stale Git worktrees and branches with a bundled script, classifies each one, and deletes only after you approve the exact candidates.

    83k GitHub stars~2.8k tokensUpdated today
    DevelopmentAuto-check passed
  • Pre-Release PR Triage

    jamiepine/voicebox

    Sorts a backlog of open pull requests into must-merge, candidate, superseded and deferred, writes a triage doc and works the merge loop before a release.

    57k GitHub stars~3.1k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Ccmanager Config

    kbwo/ccmanager

    Set up, review, or repair a CCManager config — .ccmanager.json at a git repository root, or the global ~/.config/ccmanager/config.json.

    1.3k GitHub stars~1.5k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Builds a Cap feature in an isolated Git worktree with disposable dev resources, verification, a recorded demo and a neutral pull request, started with /building.

    23k GitHub stars~2.5k tokensUpdated today
    DevelopmentAuto-check: warnings

More from letehaha/moneymatter

All 10 skills in this repo
  • Spec Planner

    letehaha/moneymatter

    Deep-dive specification planner. An agent skill from letehaha/moneymatter.

    160 GitHub stars~1.8k tokensUpdated today
    Auto-check: notes
  • Add MCP Tool

    letehaha/moneymatter

    Add a new tool to the MoneyMatter MCP server. An agent skill from letehaha/moneymatter.

    160 GitHub stars~1.9k tokensUpdated today
    Auto-check: notes
  • Find Slop

    letehaha/moneymatter

    Hunt "AI slop" in this codebase — duplication, reinvented wheels, over-engineering, defensive cruft, dead code, comment slop, performance antipatterns.

    160 GitHub stars~3k tokensUpdated today
    Auto-check passed
  • Frontend Rules

    letehaha/moneymatter

    Frontend conventions and component usage rules. An agent skill from letehaha/moneymatter.

    160 GitHub stars~3.8k tokensUpdated today
    Auto-check passed
  • I18n Before Release

    letehaha/moneymatter

    Occasional i18n catch-up: strip unused en keys, then fill any uk translations that slipped through via i18n-editor subagents.

    160 GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • E2E Test Creator

    letehaha/moneymatter

    Creates backend e2e tests for new or existing endpoints. An agent skill from letehaha/moneymatter.

    160 GitHub stars~2.4k tokensUpdated today
    Auto-check: warnings

Works with

Categories

Questions about Worktree

What does Worktree do?

Manage git worktrees for parallel Claude Code sessions. An agent skill from letehaha/moneymatter. Worktree is an agent skill from letehaha/moneymatter. Manage git worktrees for parallel Claude Code sessions.

When should I use Worktree?

Worktree fits situations like: user says worktree; create worktree; parallel session; wants to work on multiple branches simultaneously.

How do I install Worktree in Claude Code?

Run `npx skills add letehaha/moneymatter --skill worktree -a claude-code`. Or copy the skill folder (.claude/skills/worktree in letehaha/moneymatter) 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 letehaha/moneymatter --skill worktree -a codex`. Or copy the skill folder (.claude/skills/worktree in letehaha/moneymatter) 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 letehaha/moneymatter --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, npm and claude). Our summary lists: Node.js. Its frontmatter pre-approves these tools: Bash, Glob, AskUserQuestion.

Does Worktree access the network?

SKILL.md contains no URLs. Its commands use git and npm, 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 notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Worktree use?

Worktree is published under the AGPL-3.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 907 tokens (SKILL.md is roughly 3.6k 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: Finishing a Development Branch (obra/superpowers, 296k stars), Finishing A Development Branch (farm-fe/farm, 5.6k stars), Git Worktree Cleanup (lobehub/lobehub, 83k stars) and Pre-Release PR Triage (jamiepine/voicebox, 57k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Worktree?

letehaha (a GitHub user) maintains it in letehaha/moneymatter, which has 160 GitHub stars. The repository holds 10 skills in this directory. The repository was last updated on October 7, 2026.

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