Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

worktrunk

БесплатноБез исполняемых скриптовНе проверен

Sets up and drives Worktrunk (the `wt` CLI) so several branches, each in its own git worktree, can be worked on at once by people or AI coding agents. Use…

TerminalSkillsот TerminalSkills★ 221 звезда на GitHub

Об этом скилле

Worktrunk

Overview

A git worktree is a second checkout of one repository in another directory, on another branch. That is the cheapest isolation available for parallel work: two agents editing two worktrees cannot overwrite each other's files, yet they share history and can merge locally. Worktrunk's wt binary wraps the bookkeeping. You name a branch and it derives the directory, runs the project's setup hooks, optionally starts a program there, reports the state of every checkout in one table, and lands a finished branch with tests run first and the leftovers removed.

Everything below was run against version 0.80.0 in a throwaway repository. Note that .worktrunk.toml and keys such as on_create or [create] copy do not exist; the real files and keys are in step 3 and step 4.

Instructions

1. Check the ground

  • git --version is 2.43 or later and wt --version answers. On Windows the command may be git-wt, because Windows Terminal owns the name wt.
  • wt config show prints both config paths, pending hook approvals, and whether shell integration is installed. Read it before changing anything.
  • Ask how finished work should land: a local merge into the default branch, or a pushed branch and a pull request. This decides step 7.

2. Install

Package managers: brew install worktrunk (macOS, Linux), cargo install worktrunk (any Rust toolchain), winget install max-sixty.worktrunk (Windows). Otherwise take the release archive and verify it before unpacking:

base=https://github.com/max-sixty/worktrunk/releases/latest/download
curl -fsSLO "$base/worktrunk-x86_64-unknown-linux-musl.tar.xz"
curl -fsSLO "$base/worktrunk-x86_64-unknown-linux-musl.tar.xz.sha256"
sha256sum -c worktrunk-x86_64-unknown-linux-musl.tar.xz.sha256
tar -xJf worktrunk-x86_64-unknown-linux-musl.tar.xz
install -m 0755 worktrunk-x86_64-unknown-linux-musl/wt "$HOME/.local/bin/wt"

Then wt config shell install, once. A child process cannot change its parent's directory, so this adds a shell function that does the cd. It edits the user's shell startup file: propose it, do not run it unasked.

3. Decide where worktrees live

The default puts each worktree beside the repository: branch fix/csv-export of ~/code/ledger-api becomes ~/code/ledger-api.fix-csv-export. To change it, set one key in the user config, ~/.config/worktrunk/config.toml (create it with wt config create):

worktree-path = "{{ repo_path }}/.worktrees/{{ branch | sanitize }}"

The default is {{ repo_path }}/../{{ repo }}.{{ branch | sanitize }}; a central folder would be ~/worktrees/{{ repo }}/{{ branch | sanitize }}. sanitize turns / into -. With the in-repo layout, add .worktrees/ to .gitignore; otherwise the main checkout shows it as untracked.

4. Write the project hooks

Project settings go in .config/wt.toml, committed with the repository (wt config create --project writes a commented starter). Hook names are fixed:

Moment Blocks until done Runs detached
Any switch pre-switch post-switch
A worktree is created pre-start post-start
Worktrunk makes a commit pre-commit post-commit
wt merge pre-merge post-merge
A worktree is removed pre-remove post-remove

A failing pre- hook cancels the operation. Use pre-start for anything the program launched with -x needs at once (dependencies, env files) and post-start for slow or long-lived jobs (dev server, cache copy). Each hook can be a string, a table of named commands that run together, or pre-merge blocks that run in sequence.

[pre-start]
deps = "npm ci"

[post-start]
caches = "wt step copy-ignored"
dev = "npm run dev -- --port {{ branch | hash_port }}"

[pre-merge]
test = "npm test"
lint = "npm run lint"

[list]
url = "http://localhost:{{ branch | hash_port }}"
  • {{ branch | hash_port }} maps a branch name to a stable port between 10000 and 19999, so every worktree gets its own dev server and wt list shows its URL.
  • wt step copy-ignored copies gitignored files (node_modules/, .env, build output) from the main worktree into the new one, using copy-on-write on APFS, btrfs and XFS. A .worktreeinclude file with gitignore-style patterns narrows it; --dry-run previews it. Python virtual environments hold absolute paths, so recreate them instead of copying.
  • Other variables: {{ worktree_path }}, {{ primary_worktree_path }}, {{ default_branch }}, {{ target }}. Values are shell-escaped already: do not quote them.

Project hooks are repository code, so Worktrunk asks before the first run and whenever a command's text changes. Without a terminal the prompt cannot appear and the command fails:

wt hook show                        # read what would run
wt config approvals add             # the user approves; saved in ~/.config/worktrunk/approvals.toml
wt switch
Полный SKILL.md на GitHub

Установить worktrunk в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

_scores.json

FAQ

Что делает скилл worktrunk?

Sets up and drives Worktrunk (the `wt` CLI) so several branches, each in its own git worktree, can be worked on at once by people or AI coding agents. Use when a user says "run three agents in parallel on this repo", "give each task its own worktree", "set up worktrunk", "wt switch does not change directory", "add a hook that installs dependencies in new worktrees", "merge this worktree back and clean it up", or asks why a hook wants approval. Covers installation, the switch / list / merge / remove loop, the two config files and their real keys, hooks and their approval step, launching agents with -x, JSON output for scripts, and safe cleanup.

Как установить скилл worktrunk?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл worktrunk запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить worktrunk с