worktrunk
Worktrunk CLIを使って、複数のAIコーディングエージェントを異なるブランチで同時に動かし、AIによる機能開発を並行して進めるなど、Gitワークツリーを効率的に管理するSkill。
📜 元の英語説明(参考)
Manage Git worktrees for parallel AI agent workflows with Worktrunk CLI. Use when: running multiple AI coding agents simultaneously on different branches, parallelizing feature development with AI, managing concurrent git worktrees.
🇯🇵 日本人クリエイター向け解説
Worktrunk CLIを使って、複数のAIコーディングエージェントを異なるブランチで同時に動かし、AIによる機能開発を並行して進めるなど、Gitワークツリーを効率的に管理するSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o worktrunk.zip https://jpskill.com/download/15573.zip && unzip -o worktrunk.zip && rm worktrunk.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/15573.zip -OutFile "$d\worktrunk.zip"; Expand-Archive "$d\worktrunk.zip" -DestinationPath $d -Force; ri "$d\worktrunk.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
worktrunk.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
worktrunkフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 1
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
Worktrunk
概要
Worktrunk は、git の worktree 管理のための CLI で、AI コーディングエージェントを並行して実行するために設計されています。Claude Code や Codex のような AI エージェントは、監督なしでより長いタスクを処理できるため、5〜10以上のエージェントを同時に管理することが可能です。Git の worktree は、各エージェントに独自の作業ディレクトリを提供し、互いの変更を上書きしないようにします。
問題点:git の worktree の UX は扱いにくいことです。新しい worktree を開始するには、ブランチ名を3回入力する必要があります。Worktrunk は、3つのコアコマンドで worktree をブランチと同じくらい簡単にします。
手順
インストール
# crates.io から
cargo install worktrunk
# または、GitHub のリリースから事前ビルドされたバイナリをダウンロード
# https://github.com/max-sixty/worktrunk/releases
コアコマンド
Switch — worktree の作成または移動:
wt switch feat # 既存の worktree に切り替え
wt switch -c feat # 新しい worktree を作成して切り替え
wt switch -c -x claude feat # 作成して Claude Code を起動
wt switch -c -x "npm test" feat # 作成して任意のコマンドを実行
List — 全ての worktree をステータス付きで表示:
wt list # ブランチ名、パス、ダーティステータス、先行/遅延を表示
Remove — worktree とブランチをクリーンアップ:
wt remove # 現在の worktree を削除
wt remove feat # 特定の worktree を削除
フックによるワークフローの自動化
# .worktrunk.toml
[hooks]
on_create = "npm install"
pre_merge = "npm test"
post_merge = "git push origin main"
ビルドキャッシュのコピー
冗長な依存関係のインストールを回避:
[create]
copy = ["node_modules", ".next", "dist"]
パステンプレート
[paths]
template = "../{repo}.{branch}" # デフォルトの命名パターン
例
例 1: SaaS アプリケーションでの並行フィーチャー開発
開発者は、Node.js SaaS アプリケーション用に3つの独立したフィーチャーを構築する必要があります。Worktrunk を使用して、3つの Claude Code エージェントを並行して実行します。
cd ~/projects/saas-app
# 自動セットアップのためのフックを設定
cat > .worktrunk.toml << 'EOF'
[hooks]
on_create = "npm install && npm run build"
pre_merge = "npm test && npm run lint"
[create]
copy = ["node_modules", ".next"]
[paths]
template = "../saas-app.{branch}"
EOF
# 3つの worktree を作成し、それぞれにタスクを実行する Claude Code を起動
wt switch -c -x "claude --prompt 'Stripe のサブスクリプション課金を、プランのアップグレード/ダウングレードのための Webhook と共に実装する'" feat/billing
wt switch -c -x "claude --prompt 'ロールベースのアクセス制御を追加する: admin, editor, viewer のロールをミドルウェアガードと共に'" feat/rbac
wt switch -c -x "claude --prompt '日付範囲フィルタリングを備えた、分析ダッシュボード用の CSV/JSON エクスポートを構築する'" feat/export
# 全ての worktree での進捗状況を監視
wt list
# feat/billing ../saas-app.feat/billing [dirty, ahead 3]
# feat/rbac ../saas-app.feat/rbac [dirty, ahead 5]
# feat/export ../saas-app.feat/export [clean, ahead 2]
# 完了したフィーチャーをマージ (pre_merge フックがテストを自動的に実行)
wt switch feat/export && wt merge
wt switch feat/rbac && wt merge
wt switch feat/billing && wt merge
例 2: 複数のエージェントによるバグ修正スプリント
チームリーダーは、4つのバグレポートをトリアージし、それぞれを独自の worktree で作業する別々のエージェントに割り当てます。
cd ~/projects/api-server
# バグごとに1つの worktree を起動
wt switch -c -x "claude --prompt '修正: POST /api/users が、メールに + 文字が含まれている場合に 500 を返す。入力サニタイズとテストを追加。'" fix/email-plus
wt switch -c -x "claude --prompt '修正: レートリミッターが OPTIONS プリフライトリクエストをカウントする。CORS プリフライトをレート制限ミドルウェアから除外。'" fix/rate-limit-cors
wt switch -c -x "claude --prompt '修正: ページネーションが、トラバーサル中にレコードが挿入された場合に重複したアイテムを返す。カーソルベースのページネーションを使用。'" fix/pagination-dupes
wt switch -c -x "claude --prompt '修正: クライアントがクローズフレームなしで切断した場合に、WebSocket 接続がリークする。ハートビートとクリーンアップを追加。'" fix/ws-leak
# どの修正が完了したかを確認
wt list
# 修正を1つずつマージし、毎回テストを実行
wt switch fix/email-plus && wt merge
wt switch fix/rate-limit-cors && wt merge
wt switch fix/pagination-dupes && wt merge
wt switch fix/ws-leak && wt merge
# 全ての修正をプッシュ
git push origin main
ガイドライン
- マージコンフリクトを避けるために、作業を独立した自己完結型のタスクに分割します。
- 発散を最小限に抑えるために、全ての worktree を同じコミットからブランチします。
- 新しい worktree に依存関係を自動的にインストールするには、
on_createフックを使用します。 - worktree の作成を高速化するために、
node_modulesとビルドキャッシュのcopyを設定します。 - 各フィーチャーをマージする前にテストを実行するには、
pre_mergeフックを使用します。 - ベースブランチを最新の状態に保つために、完了したフィーチャーを速やかにマージします。
- ワークスペースを整理するために、
wt removeでマージ後に worktree をクリーンアップします。 - アクティブな全てのエージェントの進捗状況を監視するために、定期的に
wt listを実行します。 - 完全なドキュメントについては、worktrunk.dev および GitHub を参照してください。
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Worktrunk
Overview
Worktrunk is a CLI for git worktree management, designed for running AI coding agents in parallel. AI agents like Claude Code and Codex can handle longer tasks without supervision, making it possible to manage 5-10+ agents simultaneously. Git worktrees give each agent its own working directory so they don't step on each other's changes.
The problem: git worktree UX is clunky — starting a new worktree requires typing the branch name three times. Worktrunk makes worktrees as easy as branches with three core commands.
Instructions
Installation
# From crates.io
cargo install worktrunk
# Or download pre-built binary from GitHub releases
# https://github.com/max-sixty/worktrunk/releases
Core Commands
Switch — create or move to a worktree:
wt switch feat # Switch to existing worktree
wt switch -c feat # Create new worktree + switch
wt switch -c -x claude feat # Create + launch Claude Code in it
wt switch -c -x "npm test" feat # Create + run any command
List — show all worktrees with status:
wt list # Shows branch names, paths, dirty status, ahead/behind
Remove — clean up worktree and branch:
wt remove # Remove current worktree
wt remove feat # Remove specific worktree
Workflow Automation with Hooks
# .worktrunk.toml
[hooks]
on_create = "npm install"
pre_merge = "npm test"
post_merge = "git push origin main"
Copy Build Caches
Avoid redundant dependency installs:
[create]
copy = ["node_modules", ".next", "dist"]
Path Templates
[paths]
template = "../{repo}.{branch}" # Default naming pattern
Examples
Example 1: Parallel Feature Development on a SaaS App
A developer needs to build three independent features for a Node.js SaaS application. They use Worktrunk to run three Claude Code agents in parallel:
cd ~/projects/saas-app
# Configure hooks for automatic setup
cat > .worktrunk.toml << 'EOF'
[hooks]
on_create = "npm install && npm run build"
pre_merge = "npm test && npm run lint"
[create]
copy = ["node_modules", ".next"]
[paths]
template = "../saas-app.{branch}"
EOF
# Create 3 worktrees, each launching Claude Code with a task
wt switch -c -x "claude --prompt 'Implement Stripe subscription billing with webhooks for plan upgrades/downgrades'" feat/billing
wt switch -c -x "claude --prompt 'Add role-based access control: admin, editor, viewer roles with middleware guards'" feat/rbac
wt switch -c -x "claude --prompt 'Build CSV/JSON export for analytics dashboard with date range filtering'" feat/export
# Monitor progress across all worktrees
wt list
# feat/billing ../saas-app.feat/billing [dirty, ahead 3]
# feat/rbac ../saas-app.feat/rbac [dirty, ahead 5]
# feat/export ../saas-app.feat/export [clean, ahead 2]
# Merge completed features (pre_merge hook runs tests automatically)
wt switch feat/export && wt merge
wt switch feat/rbac && wt merge
wt switch feat/billing && wt merge
Example 2: Bug Fix Sprint with Multiple Agents
A team lead triages 4 bug reports and assigns each to a separate agent working in its own worktree:
cd ~/projects/api-server
# Spin up one worktree per bug
wt switch -c -x "claude --prompt 'Fix: POST /api/users returns 500 when email contains + character. Add input sanitization and test.'" fix/email-plus
wt switch -c -x "claude --prompt 'Fix: Rate limiter counts OPTIONS preflight requests. Exclude CORS preflight from rate limit middleware.'" fix/rate-limit-cors
wt switch -c -x "claude --prompt 'Fix: Pagination returns duplicate items when records are inserted during traversal. Use cursor-based pagination.'" fix/pagination-dupes
wt switch -c -x "claude --prompt 'Fix: WebSocket connections leak when clients disconnect without close frame. Add heartbeat and cleanup.'" fix/ws-leak
# Check which fixes are done
wt list
# Merge fixes one by one, running tests each time
wt switch fix/email-plus && wt merge
wt switch fix/rate-limit-cors && wt merge
wt switch fix/pagination-dupes && wt merge
wt switch fix/ws-leak && wt merge
# Push all fixes
git push origin main
Guidelines
- Break work into independent, self-contained tasks to avoid merge conflicts
- Branch all worktrees from the same commit to minimize divergence
- Use
on_createhooks to automatically install dependencies in new worktrees - Configure
copyfornode_modulesand build caches to speed up worktree creation - Use
pre_mergehooks to run tests before merging each feature - Merge completed features promptly to keep the base branch fresh
- Clean up worktrees after merging with
wt removeto keep your workspace tidy - Run
wt listregularly to monitor progress across all active agents - See worktrunk.dev and GitHub for full docs