Agent skill

Worktrunk Git Worktree Manager

by jjmartres in jjmartres/opencode

Guides use of Worktrunk (wt), a CLI that makes git worktrees as easy as branches so several AI agents can work in parallel on isolated branches.

MITAuto-check: notesDevelopment

Install Worktrunk Git Worktree Manager

skills CLI
$ npx skills add jjmartres/opencode --skill worktrunk -a claude-code

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

GitHub CLI
$ gh skill install jjmartres/opencode worktrunk --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/jjmartres/opencode.git skills-src && mkdir -p .claude/skills && cp -r skills-src/opencode/skills/worktrunk .claude/skills/worktrunk && 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
worktrunk
GitHub stars
133
Token cost
~1.9k tokens
SKILL.md length
418 words
Files
3 (incl. references)
Skills in repo
11
Repo updated
First seen
Licence
MIT

At a glance

Guides use of Worktrunk (wt), a CLI that makes git worktrees as easy as branches so several AI agents can work in parallel on isolated branches.

  • Works in 4 steps: Create and Switch → Inspect Status → Parallel Agents Pattern → …
  • Running several agent sessions in parallel on separate git branches
  • SKILL.md covers Quick Reference, Installation, Core Workflow and Hooks, plus 6 more sections
  • Calls claude, git and brew

What it does

This skill covers Worktrunk, a command line tool for managing git worktrees, built to run coding agents such as Claude Code in parallel across isolated branches. It lists the core commands: wt switch --create to make a branch and worktree, with -x to launch Claude inside it, wt list for the status of every worktree, wt merge main to merge and clean up, wt remove, and wt step commit for staged changes.

Installation uses Homebrew on macOS and Linux plus wt config shell install, which is required so wt switch can change the shell's directory. Worktrees default to a sibling folder named after the repo and branch, and wt list marks the current one and shows staged and unstaged changes, ahead and behind counts, and whether Claude is working or waiting. Reference files cover the full command list and hooks, and the description adds wt.toml configuration, LLM commit messages and per-worktree setup of dev servers, databases and dependencies.

When your agent uses it

  • Running several agent sessions in parallel on separate git branches
  • Setting up wt hooks or editing wt.toml
  • Creating, listing, merging or removing worktrees with wt
  • Automating dependency or dev server setup for every new worktree

Example prompts

  • “Start three worktrees with wt, one per task, and launch Claude in each.”
  • “How do I configure a wt hook that installs dependencies in every new worktree?”
  • “List my worktrees with wt and merge the finished feature branch into main.”

Requirements

  • Worktrunk (`wt`) installed, for example with Homebrew
  • Shell integration enabled with `wt config shell install`
  • Git

Workflow steps

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

  1. Create and Switch
  2. Inspect Status
  3. Parallel Agents Pattern
  4. Merge or Clean Up

What it can do on your machine

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

    • claude
    • git
    • brew
    • cargo
    • winget
    • gh

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

  • Network

    Links to these hosts (documentation or services it may open):

    • worktrunk.dev

    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

Worktrunk Git Worktree Manager loads about 1.9k tokens when it runs, and up to ~3.6k if it reads all its reference files. Until then it costs about 151 tokens; SKILL.md has 418 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~151
When it runs · the whole SKILL.md, loaded when a task matches
~1.9k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3.6k

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:233
    env = "cp {{ primary_worktree_path }}/.env.local .env.local 2>/dev/null || true"

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 jjmartres/opencode at commit 28dc323, republished under its MIT licence (© jjmartres). 418 words, ~1,917 tokens.

Download SKILL.mdSave it as .claude/skills/worktrunk/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
worktrunk
description
Use this skill when the user asks about Worktrunk (wt), git worktree management, running parallel AI agents with worktrees, setting up wt hooks, configuring wt.toml, using `wt switch`, `wt list`, `wt merge`, `wt remove`, `wt step`, LLM commit messages, or integrating Worktrunk with your AI agent. Also trigger when the user wants to run multiple AI agent sessions in parallel across isolated git branches, or automate dev server / database / dependency setup per worktree. Always use this skill for any question involving the `wt` CLI, worktree lifecycle automation, or the worktrunk plugin.

Worktrunk Skill

Worktrunk (wt) is a CLI for git worktree management designed to run AI agents (like Claude Code) in parallel across isolated branches. Think of it as making git worktree as easy as git branch.

Quick Reference

TaskCommand
Create worktree + switchwt switch --create feat
Create worktree + launch Claudewt switch --create feat -x claude
List all worktreeswt list
Merge & clean upwt merge main
Remove current worktreewt remove
Commit staged changeswt step commit

Installation

bash
# macOS/Linux (recommended)
brew install worktrunk && wt config shell install

# Cargo
cargo install worktrunk && wt config shell install

# Windows
winget install max-sixty.worktrunk
git-wt config shell install

Shell integration (wt config shell install) is required so that wt switch can actually change the shell's directory.

Core Workflow

1. Create and Switch
bash
wt switch --create feature-auth         # New branch + worktree
wt switch --create feature-auth -x claude  # + launch Claude in it
wt switch existing-branch               # Switch to existing worktree
wt switch -                             # Previous worktree

Worktrees are placed at ../repo.branch-name by default (configurable).

2. Inspect Status
bash
wt list                    # All worktrees with status, commits, CI
wt list --full --branches  # Include remote branches without worktrees
wt list --format=json      # Machine-readable output

Key indicators in wt list:

  • @ = current worktree
  • + / - = staged / unstaged changes
  • ↑ / ↓ = ahead / behind remote
  • ⇡ / ⇣ = ahead / behind default branch
  • 🤖 = Claude is working (Claude Code plugin)
  • 💬 = Claude waiting for input
3. Parallel Agents Pattern
bash
wt switch -x claude -c feature-a -- 'Add user authentication'
wt switch -x claude -c feature-b -- 'Fix the pagination bug'
wt switch -x claude -c feature-c -- 'Write tests for the API'

-x / --execute runs a command after switching; arguments after -- are passed to it.

4. Merge or Clean Up

PR workflow:

bash
wt step commit              # Commit staged changes with optional LLM message
gh pr create                # Open PR
wt remove                   # After PR merged

Local merge (squash + rebase + fast-forward):

bash
wt merge main
# Commits, rebases onto main, fast-forward merges, removes worktree

Hooks

Hooks automate worktree lifecycle events. Define in .config/wt.toml (project) or ~/.config/worktrunk/config.toml (user/global).

See references/hooks.md for the full hook reference, template variables, and common patterns (dev servers, databases, cold-start elimination).

Hook Types at a Glance
HookWhenBlocking
post-createAfter creationYes (blocks --execute)
post-startAfter creationNo (background)
post-switchEvery switchNo
pre-commitBefore merge commitYes
pre-mergeBefore mergeYes
post-mergeAfter mergeYes
pre-removeBefore removalYes
post-removeAfter removalNo
Show full SKILL.md (173 more words)Show less
Essential Hook Patterns

Eliminate cold starts (copy deps/caches/env from main):

toml
[post-start]
copy = "wt step copy-ignored"

Dev server per worktree (deterministic port from branch name):

toml
[post-start]
server = "npm run dev -- --port {{ branch | hash_port }}"
[pre-remove]
server = "lsof -ti :{{ branch | hash_port }} -sTCP:LISTEN | xargs kill 2>/dev/null || true"

Local CI gate (run tests before merge):

toml
[pre-merge]
test = "npm test"
build = "npm run build"

Template Variables & Filters

In hook commands (Jinja2 syntax):

VariableValue
{{ branch }}Branch name
{{ repo }}Repository directory name
{{ worktree_path }}Absolute path to this worktree
{{ default_branch }}Default branch name
{{ target }}Target branch (merge hooks only)
FilterExampleOutput
sanitize{{ branch | sanitize }}/ and \ → -
sanitize_db{{ branch | sanitize_db }}DB-safe identifier
hash_port{{ branch | hash_port }}Stable port 10000-19999

LLM Commit Messages

Generate commit messages from diffs:

bash
wt step commit              # Commit staged changes, generate message
wt step commit --all        # Stage all + commit

Configure in ~/.config/worktrunk/config.toml:

toml
[commit.generation]
model = "claude-opus-4-5"   # or any supported model
provider = "anthropic"

Claude Code Integration

Install the plugin for activity tracking (🤖 / 💬 in wt list) and configuration skill:

bash
claude plugin marketplace add max-sixty/worktrunk
claude plugin install worktrunk@worktrunk

Add to ~/.claude/settings.json for statusline:

json
{
  "statusLine": {
    "type": "command",
    "command": "wt list statusline --format=claude-code"
  }
}

Zellij Integration

Spawn agent handoffs directly into Zellij panes (great with your existing Zellij setup):

bash
zellij run -- wt switch --create fix-auth -x claude -- \
  'Fix the session timeout bug in auth module'

Or use hooks for a full multi-pane layout per worktree:

toml
# .config/wt.toml
[post-create]
zellij = """
zellij action new-tab --name {{ branch | sanitize }}
zellij action new-pane -- claude
"""

Common Commands for devops Work

For microservice's repos, a typical .config/wt.toml:

toml
[post-create]
env = "cp {{ primary_worktree_path }}/.env.local .env.local 2>/dev/null || true"

[post-start]
copy = "wt step copy-ignored"

[pre-merge]
lint = "make lint"
test = "make test"

[post-merge]
notify = "echo '✓ Merged {{ branch }} → {{ target }}'"

Further Reference

© jjmartres, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (references) in opencode/skills/worktrunk of jjmartres/opencode.

  • SKILL.md
  • references/commands.md
  • references/hooks.md

Open the folder on GitHubat commit 28dc323

Compare with similar skills

Worktrunk Git Worktree Manager 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.

Worktrunk Git Worktree Manager compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Worktrunk Git Worktree Manager this skilljjmartres/opencode133—~1.9kAutomated safety check: NotesMIT
Git Committisfeng/Easydict15k—~535Automated safety check: PassGPL-3.0
Kanvibe Release Deployrookedsysc/kanvibe143—~12kAutomated safety check: NotesAGPL-3.0
Worktree Rebase Mergetisfeng/Easydict15k—~408Automated safety check: PassGPL-3.0
Conventional Gitsamber/cc-skills228—~1.8kAutomated safety check: PassMIT
Git PR Workflowandymai/brepjs114—~2.9kAutomated safety check: PassApache-2.0

Similar skills

  • Git Commit

    tisfeng/Easydict

    起草、创建或汇报 Angular-style 本地 Git 提交。用于明确的提交交付;分支集成使用 worktree-rebase-merge,不 push。

    15k GitHub stars~535 tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Kanvibe Release Deploy

    rookedsysc/kanvibe

    A skill your agent uses whenever releasing or deploying KanVibe desktop from a clean, up-to-date dev checkout: ask only for the target version and release-note approval, then let the AI update…

    143 GitHub stars~12k tokensUpdated today
    DevelopmentAuto-check: notes
  • Worktree Rebase Merge

    tisfeng/Easydict

    将当前 worktree 的任务提交 rebase 到本地目标分支,并从目标 worktree 合并。用于明确要求本地集成;仅创建提交使用 git-commit。

    15k GitHub stars~408 tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Conventional Git

    samber/cc-skills

    Conventional Commits v1.0.0 branch naming, worktree naming, and commit message standards for GitHub and GitLab projects.

    228 GitHub stars~1.8k tokensUpdated 6 days ago
    DevelopmentAuto-check passed
  • 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 today
    DevelopmentAuto-check passed
  • Oma Scm

    first-fluke/oh-my-agent

    SCM (software configuration management) and Git — branching, merges, conflicts, worktrees, baselines, audit readiness, plus Conventional Commits and safe staging.

    1.3k GitHub stars~3.3k tokensUpdated yesterday
    DevelopmentAuto-check: notes

More from jjmartres/opencode

All 11 skills in this repo
  • Mermaid Diagrams

    jjmartres/opencode

    Helps an agent pick the right Mermaid diagram type and write the syntax for class, sequence, flow, ER, C4, state and other software diagrams.

    133 GitHub starsUsed in 6 repos~1.9k tokens
    Auto-check passed
  • Marp Slide Creator

    jjmartres/opencode

    Builds Marp slide decks in one of seven ready-made themes, using bundled templates plus syntax, image and style references to keep slides short and readable.

    133 GitHub starsUsed in 3 repos~2.2k tokens
    Auto-check passed
  • Lets an agent view, create, update and transition Jira issues in natural language, automatically choosing between the jira CLI and Atlassian MCP tools.

    133 GitHub starsUsed in 3 repos~1.7k tokens
    Auto-check passed
  • Google Style Code Docs

    jjmartres/opencode

    Applies Google Style documentation to Python docstrings, Go comments and Terraform descriptions, for writing new docs or reviewing existing ones.

    133 GitHub stars~1.9k tokensUpdated 5 mo ago
    Auto-check passed
  • A skill your agent uses when writing prose humans will read—documentation, commit messages, error messages, explanations, reports, or UI text.

    133 GitHub starsUsed in 6 repos~1k tokens
    Auto-check passed
  • Asdf

    jjmartres/opencode

    A skill your agent uses whenever the user wants to install, configure, or use asdf (asdf-vm), the universal version manager.

    133 GitHub stars~2.1k tokensUpdated 5 mo ago
    Auto-check: notes

Works with

Questions about Worktrunk Git Worktree Manager

What does Worktrunk Git Worktree Manager do?

Guides use of Worktrunk (wt), a CLI that makes git worktrees as easy as branches so several AI agents can work in parallel on isolated branches. This skill covers Worktrunk, a command line tool for managing git worktrees, built to run coding agents such as Claude Code in parallel across isolated branches. It lists the core commands: wt switch --create to make a branch and worktree, with -x to launch Claude inside it, wt list for the status of every worktree, wt merge main to merge and clean up, wt remove, and wt step commit for staged changes.

When should I use Worktrunk Git Worktree Manager?

Worktrunk Git Worktree Manager fits situations like: running several agent sessions in parallel on separate git branches; setting up wt hooks or editing wt.toml; creating, listing, merging or removing worktrees with wt; automating dependency or dev server setup for every new worktree.

How do I install Worktrunk Git Worktree Manager in Claude Code?

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

How do I install Worktrunk Git Worktree Manager in Codex?

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

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

What does Worktrunk Git Worktree Manager need to run?

Going by SKILL.md and its folder, Worktrunk Git Worktree Manager needs the command-line tools its instructions call (claude, git, brew, cargo, winget and gh). Our summary lists: Worktrunk (`wt`) installed, for example with Homebrew; Shell integration enabled with `wt config shell install`; Git.

Does Worktrunk Git Worktree Manager access the network?

SKILL.md names 1 domain. As links in the text: worktrunk.dev. This is read from the text; nothing was executed.

Is Worktrunk Git Worktree Manager 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 Worktrunk Git Worktree Manager use?

Worktrunk Git Worktree Manager 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 Worktrunk Git Worktree Manager use?

About 1.9k tokens (SKILL.md is roughly 7.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.7k tokens, read only when the agent opens those files.

What are the alternatives to Worktrunk Git Worktree Manager?

Skills that share tags, products or a category with Worktrunk Git Worktree Manager: Git Commit (tisfeng/Easydict, 15k stars), Kanvibe Release Deploy (rookedsysc/kanvibe, 143 stars), Worktree Rebase Merge (tisfeng/Easydict, 15k stars) and Conventional Git (samber/cc-skills, 228 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Worktrunk Git Worktree Manager?

jjmartres (a GitHub user) maintains it in jjmartres/opencode, which has 133 GitHub stars. The repository holds 11 skills in this directory. The repository was last updated on April 20, 2026.

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