Agent skill

Git Worktree Runner

by dyoshikawa in dyoshikawa/rulesync

Manages git worktrees using git-worktree-runner (gtr). An agent skill from dyoshikawa/rulesync.

MITAuto-check: notesDevelopment

Install Git Worktree Runner

skills CLI
$ npx skills add dyoshikawa/rulesync --skill git-worktree-runner -a claude-code

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

GitHub CLI
$ gh skill install dyoshikawa/rulesync git-worktree-runner --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/dyoshikawa/rulesync.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.rulesync/skills/git-worktree-runner .claude/skills/git-worktree-runner && 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-worktree-runner
GitHub stars
1.5k
Token cost
~1.3k tokens
SKILL.md length
198 words
Files
1
Skills in repo
40
Repo updated
First seen
Licence
MIT

At a glance

Manages git worktrees using git-worktree-runner (gtr). An agent skill from dyoshikawa/rulesync.

  • Works in 5 steps: Get PR metadata → Check for existing worktree with the… → Fetch the PR ref into a local branch… → …
  • The user needs to create
  • SKILL.md covers Quick Start, Commands, Configuration and Example: Parallel AI Development, plus 3 more sections
  • Calls git and gh

What it does

Git Worktree Runner is an agent skill from dyoshikawa/rulesync. Manages git worktrees using git-worktree-runner (gtr). Use when the user needs to create, list, remove, or navigate worktrees with git gtr commands, open editors or AI tools in worktrees, manage parallel development branches, or check out GitHub PRs (including from forks) into 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 Development, covering Git worktrees. It works with Git and GitHub. The repository describes itself as: A Utility CLI for AI Coding Agents. The licence is MIT.

When your agent uses it

  • The user needs to create
  • Navigate worktrees with git gtr commands
  • AI tools in worktrees
  • Manage parallel development branches

Example prompts

  • “Use the git-worktree-runner skill to manage git worktrees using git-worktree-runner (gtr). An agent skill from dyoshikawa/rulesync”
  • “/git-worktree-runner”

Requirements

  • Pre-approved tools (allowed-tools): Bash(git-worktree-runner:*)

Workflow steps

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

  1. Get PR metadata
  2. Check for existing worktree with the same branch name
  3. Fetch the PR ref into a local branch (use --force to handle diverged history from force-pushes)
  4. Create the worktree with --track local since it's a local-only branch
  5. Verify

What it can do on your machine

Read from SKILL.md and the folder at commit 85bcaf6. 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(git-worktree-runner:*)

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git
    • gh

    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 gh, 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 Worktree Runner loads about 1.3k tokens when it runs. Until then it costs about 78 tokens; SKILL.md has 198 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~78
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: notes

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

  • NoteMentions a .env fileSKILL.md:106
    git gtr config add gtr.copy.include "**/.env"
  • NoteMentions a .env fileSKILL.md:107
    git gtr config add gtr.copy.include "**/.env.local"

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 dyoshikawa/rulesync at commit 85bcaf6, republished under its MIT licence (© dyoshikawa). 198 words, ~1,292 tokens.

Download SKILL.mdSave it as .claude/skills/git-worktree-runner/SKILL.md (or your agent's skills folder).
name
git-worktree-runner
description
Manages git worktrees using git-worktree-runner (gtr). Use when the user needs to create, list, remove, or navigate worktrees with `git gtr` commands, open editors or AI tools in worktrees, manage parallel development branches, or check out GitHub PRs (including from forks) into worktrees.
allowed-tools
Bash(git-worktree-runner:*)
targets
*

Git Worktree Runner (gtr)

git-worktree-runner (gtr) is a CLI tool that wraps git worktree with quality-of-life features for modern development workflows including editor and AI tool integration.

Quick Start

bash
# Create a new worktree
git gtr new feature-branch

# Create from a remote branch
git gtr new my-branch --from origin/feature-branch

# Open editor in the worktree
git gtr editor feature-branch

# Start AI tool (claude, codex, etc.) in the worktree
git gtr ai feature-branch

# Remove a worktree
git gtr rm feature-branch

Commands

Creating Worktrees
bash
# Create a new worktree with a new branch
git gtr new feature-name

# Create from a specific ref (remote branch, tag, commit)
git gtr new my-branch --from origin/main
git gtr new hotfix --from v1.2.3

# Create and immediately open in editor
git gtr new feature -e

# Create and immediately start AI tool
git gtr new feature -a

# Create with both editor and AI tool
git gtr new feature -e -a
Opening Editor / AI Tool
bash
# Open the configured editor for a worktree
git gtr editor feature-branch

# Start configured AI tool in a worktree
git gtr ai feature-branch
Running Commands
bash
# Run an arbitrary command in a worktree
git gtr run feature-branch npm test
git gtr run feature-branch pnpm build
Navigation
bash
# Navigate to a worktree directory
cd "$(git gtr go feature-branch)"
Listing and Managing
bash
# List all worktrees
git gtr list

# Remove a worktree
git gtr rm feature-branch

# Rename a worktree
git gtr mv old-name new-name

Configuration

bash
# Set default editor (cursor, vscode, zed, etc.)
git gtr config set gtr.editor.default cursor

# Set default AI tool (claude, codex, opencode, aider, etc.)
git gtr config set gtr.ai.default claude

# Configure files to copy into new worktrees
git gtr config add gtr.copy.include "**/.env"
git gtr config add gtr.copy.include "**/.env.local"
git gtr config add gtr.copy.include "**/.env.example"

# View current configuration
git gtr config list

Example: Parallel AI Development

bash
# Create isolated worktrees for parallel AI agents
git gtr new feature-auth --from origin/main
git gtr new feature-api --from origin/main
git gtr new bugfix-login --from origin/main

# Start AI tools in each worktree
git gtr ai feature-auth
git gtr ai feature-api
git gtr ai bugfix-login

# Check status of all worktrees
git gtr list

# Clean up when done
git gtr rm feature-auth
git gtr rm feature-api
git gtr rm bugfix-login

Example: PR Review in Isolated Worktree

bash
# Create a worktree from PR branch
git gtr new review-pr-123 --from origin/pr-branch

# Open in editor to review
git gtr editor review-pr-123

# Run tests in isolation
git gtr run review-pr-123 pnpm test

# Clean up after review
git gtr rm review-pr-123

Example: Hotfix While Working on Feature

bash
# Current work is on feature-branch, need to do a hotfix
git gtr new hotfix-critical --from origin/main

# Open editor for the hotfix
git gtr new hotfix-critical -e

# After hotfix is done, remove the worktree
git gtr rm hotfix-critical
# Back to feature-branch work without context switching

Example: Checkout a Fork PR into Worktree

For PRs from forked repositories, the branch is not on origin. Use GitHub's refs/pull/<number>/head ref to fetch it.

Procedure

Given a PR number or URL:

  1. Get PR metadata

    bash
    gh pr view <PR_NUMBER> --json headRefName,isCrossRepository
  2. Check for existing worktree with the same branch name

    bash
    git worktree list

    If it exists, remove it first: git gtr rm <branch>

  3. Fetch the PR ref into a local branch (use --force to handle diverged history from force-pushes)

    bash
    git fetch origin pull/<PR_NUMBER>/head:<BRANCH_NAME> --force
  4. Create the worktree with --track local since it's a local-only branch

    bash
    git gtr new <BRANCH_NAME> --track local
  5. Verify

    bash
    git gtr list
Full example (PR #1223 from a fork)
bash
gh pr view 1223 --json headRefName,isCrossRepository
git fetch origin pull/1223/head:fix/comprehensive-file-formats-docs --force
git gtr new fix/comprehensive-file-formats-docs --track local
git gtr list
Shortening long branch names
bash
git fetch origin pull/1223/head:pr-1223 --force
git gtr new pr-1223 --track local
Common errors
  • "refusing to fetch into branch checked out at...": A worktree with that branch exists. git gtr rm <branch> first.
  • "non-fast-forward" rejected: Local branch diverged. Add --force to the fetch.
  • Both errors: Remove the worktree first, then fetch with --force.

© dyoshikawa, 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 .rulesync/skills/git-worktree-runner of dyoshikawa/rulesync.

Open the folder on GitHubat commit 85bcaf6

Compare with similar skills

Git Worktree Runner 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 Worktree Runner compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Git Worktree Runner this skilldyoshikawa/rulesync1.5k—~1.3kAutomated safety check: NotesMIT
Fix Issuenex-agi/NexRL119—~733Automated safety check: PassApache-2.0
Branch Standup Facilitatorthedotmack/claude-mem98k—~1.7kAutomated safety check: NotesApache-2.0
Project Session ManagerYeachan-Heo/oh-my-claudecode40k—~4kAutomated safety check: PassMIT
Pre-Release PR Triagejamiepine/voicebox57k—~3.1kAutomated safety check: PassMIT
Ff Worktreesdamus-io/damus2.1k—~451Automated safety check: PassGPL-3.0

Similar skills

  • Fix Issue

    nex-agi/NexRL

    Fix a GitHub issue using git worktree for isolation. An agent skill from nex-agi/NexRL.

    119 GitHub stars~733 tokensUpdated 21 days ago
    DevelopmentAuto-check passed
  • Branch Standup Facilitator

    thedotmack/claude-mem

    Facilitates a read-only standup between git worktrees, branches or PRs, where each acts as an agent in a shared markdown chat to agree one consolidation plan.

    98k GitHub stars~1.7k tokensUpdated yesterday
    DevelopmentAuto-check: notes
  • Project Session Manager

    Yeachan-Heo/oh-my-claudecode

    Creates isolated git worktrees, with optional tmux sessions, for PR reviews, issue fixes and feature work across projects and repositories.

    40k GitHub stars~4k 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
  • Ff Worktrees

    damus-io/damus

    Fast-forward master and every git worktree branch up to a target ref (default github/master), skipping any worktree with unmerged commits.

    2.1k GitHub stars~451 tokensUpdated 26 days ago
    DevelopmentAuto-check passed
  • Clean Complete Branches

    jtenniswood/espcontrol

    Clean up completed Git branches and worktrees for this repository both locally and on GitHub.

    1.1k GitHub stars~820 tokensUpdated today
    DevelopmentAuto-check passed

More from dyoshikawa/rulesync

All 40 skills in this repo
  • Rulesync Feature Research

    dyoshikawa/rulesync

    Maps rulesync feature implementations to upstream coding-agent documentation.

    1.5k GitHub stars~1.8k tokensUpdated today
    Auto-check passed
  • Babysit Dependabot PR

    dyoshikawa/rulesync

    Babysit a Dependabot dependency-bump PR all the way to merge: verify the author is the genuine Dependabot bot, diagnose and resolve any CI failure (excluding or fixing a breaking bump when needed)…

    1.5k GitHub stars~1.3k tokensUpdated today
    Auto-check passed
  • Commit Push PR

    dyoshikawa/rulesync

    Commit current changes, push to remote, and create or update a pull request.

    1.5k GitHub stars~458 tokensUpdated today
    Auto-check passed
  • Goal PR

    dyoshikawa/rulesync

    Drive a pull request to a clean state and merge it: run the review-pr skill, fix every mid-or-above finding, and repeat until no mid-or-above findings remain, then merge.

    1.5k GitHub stars~1.4k tokensUpdated today
    Auto-check passed
  • Goal Release

    dyoshikawa/rulesync

    Cut a release end to end: use the draft-release skill to open the release PR and draft GitHub release, wait for CI to turn green, run the merge-pr skill to merge the release PR, then update the…

    1.5k GitHub stars~2k tokensUpdated today
    Auto-check passed
  • PRs Awaiting Author

    dyoshikawa/rulesync

    List open pull requests where the ball is in the author's court: CI is failing, review comments are unaddressed, or a maintainer question is awaiting the author's reply.

    1.5k GitHub stars~887 tokensUpdated today
    Auto-check passed

Works with

Questions about Git Worktree Runner

What does Git Worktree Runner do?

Manages git worktrees using git-worktree-runner (gtr). An agent skill from dyoshikawa/rulesync. Git Worktree Runner is an agent skill from dyoshikawa/rulesync. Manages git worktrees using git-worktree-runner (gtr).

When should I use Git Worktree Runner?

Git Worktree Runner fits situations like: the user needs to create; navigate worktrees with git gtr commands; AI tools in worktrees; manage parallel development branches.

How do I install Git Worktree Runner in Claude Code?

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

How do I install Git Worktree Runner in Codex?

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

Can I use Git Worktree Runner 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 dyoshikawa/rulesync --skill git-worktree-runner -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-worktree-runner, .gemini/skills/git-worktree-runner, .github/skills/git-worktree-runner and .opencode/skills/git-worktree-runner in your project.

What does Git Worktree Runner need to run?

Going by SKILL.md and its folder, Git Worktree Runner needs the command-line tools its instructions call (git and gh). Its frontmatter pre-approves these tools: Bash(git-worktree-runner:*).

Does Git Worktree Runner access the network?

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

Is Git Worktree Runner safe to install?

Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Git Worktree Runner use?

Git Worktree Runner 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 Git Worktree Runner 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 Git Worktree Runner?

Skills that share tags, products or a category with Git Worktree Runner: Fix Issue (nex-agi/NexRL, 119 stars), Branch Standup Facilitator (thedotmack/claude-mem, 98k stars), Project Session Manager (Yeachan-Heo/oh-my-claudecode, 40k 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 Git Worktree Runner?

dyoshikawa (a GitHub user) maintains it in dyoshikawa/rulesync, which has 1,507 GitHub stars. The repository holds 40 skills in this directory. The repository was last updated on October 8, 2026.

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